# Gail Myers
# 7/1/15
#
# (c) Willoughby-Eastlake School of Innovation
# Permission granted for experimental and personal use;
# license for commercial sale available from Willoughby-Eastlake School of Innovation.
(c) Gail E. Myers 2015 Permission granted for experimental and personal use. License for commercial sale available from Gail E. Myers
// Set Arduino IDE for board - ATtiny44 (internal 8 MHz clock)
// the setup function runs once when you press reset or power the board
void setup() {
pinMode(8, OUTPUT);// set pin to putput for led win
pinMode(7,OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
if(analogRead(A0) > 200) // read analog 0 input check to see if car
went thru lane
{
digitalWrite(7,HIGH);// set led output for who won
digitalWrite(8,LOW);
delay(20000);// delay for 20 sec
digitalWrite(8,LOW);// reset
digitalWrite(7,LOW);
}
if(analogRead(A1) > 200) // read analog 1 input to see if car went thru
lane
{
digitalWrite(8,HIGH); //set led lane output for who won
digitalWrite(7,LOW);
delay(20000);//delay 20 sec
digitalWrite(8,LOW);
digitalWrite(7,LOW);// reset
}
}