Author Topic: Digispark not writing to P1-P2  (Read 1804 times)

adrianforest

  • Newbie
  • *
  • Posts: 1
Digispark not writing to P1-P2
« on: September 09, 2017, 08:57:42 am »
I'm trying to get my Digispark to light three LEDs, on P1, P2 and P5, but right now the only pin it'll write to is P5.

Here's the code:

Code: [Select]
//initialize LED pins
#define green 1
#define yellow 2
#define red 5

void setup()
{
 
}

void loop()
{
 
  digitalWrite(red, HIGH);
  digitalWrite(yellow, HIGH);
  digitalWrite(green, HIGH);
}

and here's my circuit diagram:



Can anyone tell me why I'm only getting output on P5?

exeng

  • Sr. Member
  • ****
  • Posts: 454
Re: Digispark not writing to P1-P2
« Reply #1 on: September 09, 2017, 03:19:32 pm »
Guessing here but you may need to set the pinMode to OUTPUT for each. Don't know why P5 behaves differently.