LilyPad Arduino Pinout

I’m trying to use more than one pin on my LilyPad Arduino. I can only get signals out of pin#2. I tried pinMode(x, OUTPUT) with all x=pin# but it keeps sending signals to pin#2 regardless of my void setup. Here's the code that's supposed to work on pin# 3 and 9 but it only goes through pin#2.

</>

void setup()
{
pinMode(3, OUTPUT);
pinMode(9, OUTPUT);

}

void loop() {
digitalWrite(3, HIGH);
digitalWrite(9, LOW);
delay(2000);
digitalWrite(5, HIGH);
digitalWrite(9, LOW);
delay(2000);

}

Please post an example sketch and schematic that exhibits this problem

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

1 Like

It seems I fixed it by selecting Programmer to Arduino as ISP.

You are repeatedly setting Pins 3 and 5 HIGH and 9 LOW so nothing is going to blink. Did you mean to write:

void loop() 
{
  digitalWrite(3, HIGH);
  digitalWrite(9, LOW);
  delay(2000);
  digitalWrite(3, LOW);
  digitalWrite(9, HIGH);
  delay(2000);
}