can I completely switch off the Builtin LED? I a working with a Nano WiFi1010 and once I read a digital Input Pin, the BUILTIN LED turns on. I have not configured it in any case.
I am working on a battery powered project and I want to extend battery life.
Please explain. The onboard LED called the "built in LED" usually works. Does your board have a power on LED? Is that what you mean? Most boards don't have one.
Hello Peter_Stuhr
Post your sketch, well formated, with well-tempered comments and in so called code tags "</>" to see how we can help.
Have a nice day and enjoy coding in C++.
int contactState = 0; // variable for reading the pushbutton status
void setup() {
pinMode(6, INPUT);
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial);
}
void loop() {
// read the state of the pushbutton value:
contactState = digitalRead(6);
// Check, obutton is pushed
if (contactState == HIGH)
{
Serial.println("Deckel wurde geöffnet :-)");
}
}
The BUILTIN_LED on an Uno is driven by an opAmp, so if you leave it as a floating input, some unknown voltage would get amplified and make it light up. Do as aarg says:
or wire pin 13 to ground.
(Interestingly, if you don't configure it as an output, you can use it as a logic probe: put a jumper in pin 13 and touch it to other signals in your circuit to read them on the LED)
void setup() {
pinMode(6, INPUT);
// new
pinMode (LED_BUILTIN,OUTPPUT);
digitalWrite(LED_BUILTIN,LOW);
//
//Initialize serial and wait for port to open:
Serial.begin(9600);
while (!Serial);
}