Last active
January 16, 2019 21:04
-
-
Save jschoch/4b79b83b8f65f57aa840d8e8ce9291c3 to your computer and use it in GitHub Desktop.
zoetrope.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <neotimer.h> | |
Neotimer strobeT = Neotimer(30); // Set timer's preset to 30 milliseconds | |
Neotimer t1 = Neotimer(1000); | |
Neotimer t2 = Neotimer(50); | |
const int BTN1 = 0; | |
const int LED = 4; | |
const int OB = 1; | |
void setup() { | |
// put your setup code here, to run once: | |
pinMode(BTN1, OUTPUT); | |
pinMode(LED, OUTPUT); | |
pinMode(OB, OUTPUT); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
if(strobeT.repeat()){ | |
digitalWrite(LED,HIGH); | |
delayMicroseconds(150); | |
digitalWrite(LED,LOW); | |
} | |
if(t1.repeat()){ | |
digitalWrite(OB,!digitalRead(OB)); | |
} | |
if(t2.repeat()){ | |
digitalWrite(BTN1,!digitalRead(BTN1)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment