Initial commit
This is just the 2018 code configured for PlatformIO
This commit is contained in:
25
lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde
Normal file
25
lib/DueTimer/examples/SimpleTimer/SimpleTimer.pde
Normal file
@ -0,0 +1,25 @@
|
||||
#include <DueTimer.h>
|
||||
|
||||
int myLed = 13;
|
||||
|
||||
bool ledOn = false;
|
||||
void myHandler(){
|
||||
ledOn = !ledOn;
|
||||
|
||||
digitalWrite(myLed, ledOn); // Led on, off, on, off...
|
||||
}
|
||||
|
||||
void setup(){
|
||||
pinMode(myLed, OUTPUT);
|
||||
|
||||
Timer3.attachInterrupt(myHandler);
|
||||
Timer3.start(50000); // Calls every 50ms
|
||||
}
|
||||
|
||||
void loop(){
|
||||
|
||||
while(1){
|
||||
// I'm stuck in here! help me...
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user