I was hoping someone might know a bit more about these boards than me. The attached code has been loaded onto an arduino Uno and it works perfectly, but when I try it in this board the LEDs don't light up. I know the program is running because the Pin13 LED lights up, but not the LEDs attached.
Your question refers to a Nano, the schematic refers to a micro. The pinouts are different.
In future, please insert the code in the post (using code tags) instead of attaching it
type ** **[code]** **
post your code after that
type ** **[/code]** **
after that
So it looks like below (done it for you)
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
int buttonPin = 5;
boolean buttonVar = false;
// the setup routine runs once when you press reset:
void setup()
{
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop()
{
if (digitalRead(buttonPin) == HIGH)
{
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(200); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(200); // wait for a second
}
else
{
digitalWrite(led, LOW);
}
}
If the built-in led on pin 13 of the Gikfun board is working, then you've probably made an error wiring your own led, or chosen an inappropriate current limiting resistor.
Test #1 is to move your led circuit to, say, pin 12 and alter the code accordingly to see if that works first. Pin 13 is not always straightforward to use because of its own built in led.