You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 21, 2020. It is now read-only.
All Arduino / open source variants I have tested (ATMEGA328, ATMEGA2560, ATSAM3X8E, SAMD, Curie, ESP8266, ATSAMD21, ESP32) will properly report an output pin's state via digitalRead();. The nrf52 based Primo does not correctly report unless the pin has been declared an input first. Example:
boolean oneshot = false;
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
Serial.println(digitalRead(LED_BUILTIN));
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
Serial.println(digitalRead(LED_BUILTIN));
if ((millis() > 15000) && !oneshot)
{
pinMode(LED_BUILTIN, INPUT);
delay(200);
pinMode(LED_BUILTIN, OUTPUT);
oneshot = true;
}
}
All Arduino / open source variants I have tested (ATMEGA328, ATMEGA2560, ATSAM3X8E, SAMD, Curie, ESP8266, ATSAMD21, ESP32) will properly report an output pin's state via digitalRead();. The nrf52 based Primo does not correctly report unless the pin has been declared an input first. Example: