Digistump Forums

The Digispark => Digispark (Original) Support => Topic started by: adrianforest on September 09, 2017, 08:57:42 am

Title: Digispark not writing to P1-P2
Post by: adrianforest 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:

(http://i.imgur.com/bbZ0KODl.png)

Can anyone tell me why I'm only getting output on P5?
Title: Re: Digispark not writing to P1-P2
Post by: exeng 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.