hi there.
maybe i am been slightly dense but i am unable to do a simple digitalWrite to pin D4.
my setup is as follows
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
this doesn't take the pin into a high state.
any suggestions?
hi there.
maybe i am been slightly dense but i am unable to do a simple digitalWrite to pin D4.
my setup is as follows
pinMode(4,OUTPUT);
digitalWrite(4,HIGH);
this doesn't take the pin into a high state.
any suggestions?
ok i have solved the issue.
based on the variant.cpp file
PA14 ( which is defined as D4 in the schematics) is actually D2 )
This seems ok on my board:
void setup() {
pinMode(4, OUTPUT);
}
void loop() {
digitalWrite(4, HIGH);
delay(1000);
digitalWrite(4, LOW);
delay(1000);
}
You probably have an Arduino.org M0 / M0+ board. It is a known difference between the Zero and the M0 : D2 and D4 are switched.