Created
December 24, 2019 19:04
-
-
Save SCI-COPATH/628d21de16854ec9a3e6031825e26fb6 to your computer and use it in GitHub Desktop.
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
#define pin 2 | |
boolean value=0; | |
const int par=100; | |
void setup() { | |
pinMode(pin,INPUT); | |
Serial.begin(9600); | |
Serial.println("Sci-COPATH 1K Give Away counter"); | |
} | |
void loop() { | |
value=digitalRead(pin); | |
if(value==1) | |
{ | |
Serial.println("Start Counting"); | |
delay(1000); | |
for(;;) | |
{ | |
for(int i=1,value=0;i<=par;i++) | |
{ | |
value=digitalRead(pin); | |
if(value==1) | |
{ | |
Serial.print("Winner is token number "); | |
Serial.println(i); | |
for(;;); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment