Go Down

Topic: Arduino Zero digitalRead in output mode (Read 673 times) previous topic - next topic

moresun

Aug 21, 2015, 09:35 am Last Edit: Aug 21, 2015, 03:59 pm by moresun
Hi

On an Arduino UNO I can read the pin state set with digitalWrite value using readRead but on an an Zero board. The following code works on an UNO/Leonardo but not on an Zero

Code: [Select]
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, !digitalRead(13) );   // turn the LED on/off
  delay(1000);              // wait for a second
}


Is there a other way to read the current pin state?


Go Up