Compare commits
2 Commits
b49517d6e8
...
blink
| Author | SHA1 | Date | |
|---|---|---|---|
|
927531fa85
|
|||
|
27ce30c0f4
|
6
include/pins.h
Normal file
6
include/pins.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef PINS
|
||||
#define PINS
|
||||
|
||||
#define LED 4
|
||||
|
||||
#endif
|
||||
18
src/main.cpp
18
src/main.cpp
@@ -1,18 +1,18 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
// put function declarations here:
|
||||
int myFunction(int, int);
|
||||
#include "pins.h"
|
||||
|
||||
#define BLINKRATE 500
|
||||
|
||||
unsigned long lastBlink = 0;
|
||||
|
||||
void setup() {
|
||||
// put your setup code here, to run once:
|
||||
int result = myFunction(2, 3);
|
||||
pinMode(LED, OUTPUT);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// put your main code here, to run repeatedly:
|
||||
if ((millis() - lastBlink) > BLINKRATE) {
|
||||
digitalWrite(LED, !digitalRead(LED));
|
||||
lastBlink= millis();
|
||||
}
|
||||
|
||||
// put function definitions here:
|
||||
int myFunction(int x, int y) {
|
||||
return x + y;
|
||||
}
|
||||
Reference in New Issue
Block a user