I'm sure it must be me doing something wrong. But for the life of me I can't write to a digital pin (except the Built in LED.
I'm using a Nano and I'm new to the Ardunio IDE. I've built upon the basic Blink application. The code below, runs and flashes the LED. I know the code is running as I can change the delay length in the code and it changes on the board. I know the pins aren’t’ changing their level as I’m looking at it on a scope/logic analyser.
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
pinMode(32, OUTPUT);
pinMode(1, OUTPUT);
pinMode(16, OUTPUT);
pinMode(15, OUTPUT);
}
// the loop function runs over and over again forever
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(32, HIGH);
digitalWrite(1, HIGH);
digitalWrite(15, HIGH);
digitalWrite(16, HIGH);
delay(200);
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(32, LOW);
digitalWrite(1, LOW);
digitalWrite(15, LOW);
digitalWrite(16, LOW);
delay(200);
}
I've tried subsitutue the pin numbers for the pin names (PB4, PB3 etc..) but that doesn't work.