This repository was archived by the owner on Apr 16, 2021. It is now read-only.
This repository was archived by the owner on Apr 16, 2021. It is now read-only.
Arduino Nano 33 BLE - Pull-down resistor not working as intended #61
Closed
Description
Hi,
I've been testing an Arduino Nano 33 BLE to test it's functionality with pull-down resistors.
int testPin = 2;
void setup() {
Serial.begin(9600);
pinMode(LEDG, OUTPUT);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(testPin, INPUT_PULLDOWN);
}
void loop() {
if(digitalRead(testPin)){
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(LEDG, HIGH);
}else{
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(LEDG, LOW);
}
Serial.println(digitalRead(testPin));
}
A switch is hooked up between 3V3 and pin D2. With this code the micro controller is acting as if it's a pull-up resistor and not pulldown. The RGB-led seems also to not handle this code without adding a minimum of delay(1);
NB! another point worth mentioning. The RGB-led is fixed to 3V3, which means the code for "LOW" and "HIGH" is inverted.