Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int j=8; //LEDS start at pin 8
- void setup() { //setup() is only gone through once
- for(int i=0; i<4; i++)
- //You have to tell the arduinoboard if pins are INPUT or OUTPUT
- pinMode(j+i, OUTPUT); //make LED-pins outputs.
- //Look at image over board. Top row is for programming pins.
- //The pins can also take input
- //I suppose for example the thermometer has to take input,
- //that is you take input FROM the thermometer and read it somehow.
- }
- // the loop function runs over and over again forever
- void loop() {
- digitalWrite(j, HIGH); //Turn pin on, this case LED
- delay(100); //delay 0.1seconds
- digitalWrite(j, LOW); //Turn it off
- delay(100); //delay 0.1seconds
- j++; //Target next pin.
- if( j>11) //if J will become 12, that is we were on the last LED-pin
- j=8; //start over on pin 8, that is, the RED LED-pin.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement