Author Topic: Suggestions for Pin assignments  (Read 1148 times)

intosite

  • Newbie
  • *
  • Posts: 1
Suggestions for Pin assignments
« on: July 24, 2017, 04:27:13 am »
Total noob here, and trying to figure out the pins.
I'm driving 3 PWM with analogWrite,
So i'm assuming i need to use P0, P1 & P4.

I have 2 switches & 1 potentiometer.
So i'm assigning them to P2&P3 for the switches & P5 for the Potentiometer.

Currently i'm testing P2 & P3 by shorting it to 5V and trigger P1 to light up to see if it works. But it doesn't seem to work.

My code in the loop is as such.
Code: [Select]
void loop {
  if ( digitalRead(2) == HIGH || digitalRead(3) == HIGH || digitalRead(5) == HIGH ) {
    digitalWrite(1, HIGH );
  }
  else {
    digitalWrite(1, LOW );
  }
}