game

I made a version of Operation that was a fishing game. There was a wire, sort of fishing rod-shaped, connected to the box that held the cups. If the wire touched the water, it would complete the circuit and the led would blink.
Here is the code I got from the Arduino Tutorials page.:
int ledPin = 13; // LED connected to digital pin 13

void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}

void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}



No comments: