Hot answers tagged

6 votes

Same LED but different brightness on same PIN

All the pins are configured as INPUT by default on startup. So if you leave out the pinMode(7, OUTPUT);, pin 7 will still be configured as input. An Input doesn't provide any current (or only a very ...
chrisl's user avatar
  • 16.1k
5 votes

Push button issues

You've got the button wired wrong. Your resistor is inline with the signal going to the pin. It should be going from the pin to 5V. The button should be wired directly to the pin and ground. Or ...
Delta_G's user avatar
  • 3,251
4 votes
Accepted

Just one more pin!

As a (slightly hacky and binary :) ) suggestion, you could use just two LEDs and free up a pin with the following... Level 1 - LED 1 on, LED 2 off Level 2 - LED 1 off, LED 2 on Level 3 - LED 1 on, LED ...
ledhacker's user avatar
4 votes
Accepted

Does the UNO R4 still have the standard on-board led on pin 13?

The schematics for the R4 Minima and Wifi boards can be found at: https://docs.arduino.cc/resources/schematics/ABX00080-schematics.pdf and https://docs.arduino.cc/resources/schematics/ABX00087-...
6v6gt's user avatar
  • 1,028
3 votes
Accepted

How to turn LEDs based on voltage readings?

You are using a Full-size breadboard, for the full-size breadboards, the power rails are divided into two half sections as shown in this picture, and you need to have jumpers to bridge the two half-...
hcheung's user avatar
  • 1,362
2 votes
Accepted

LED doesn't completely turn off with digitalWrite(led, LOW);

if (!digitalRead(led3) && difference>=600){ digitalWrite(led3, HIGH); } if (!digitalRead(led4) && difference>=800){ digitalWrite(led4, HIGH); } if (difference>=1000){ ...
Nick Gammon's user avatar
  • 38.1k
2 votes
Accepted

ESP8266 seems to be killing a while loop

You can't trap an ESP in a while loop like that. There are things it needs to get back to main and do between loops. Instead, let the loop function be your loop. Make the while statements if ...
Delta_G's user avatar
  • 3,251
2 votes

How to turn LEDs based on voltage readings?

I can say your code is working but you need to check the wirering of your circuit . Note that the voltage on the analogread pin should not be an oscillating voltage at low frequency like AC voltage. ...
Joseph Afodu's user avatar
2 votes

fastLED help - special reinforcements needed

Here is an example sketch that shows how to manipulate data in a sub-section of an array. https://wokwi.com/projects/362275278547275777 The important thing to understand, is that the FastLED.show(); ...
jsotola's user avatar
  • 1,444
2 votes
Accepted

strip.clear() is not clearing/turning off the NeoPixel strip after resetting the ESP8266

We can have a look at the clear() function inside the Adafruit_Neopixel library. In Adafruit_Neopixel.cpp you can find at line 3396 (searching for clear(void) will get you there): void ...
chrisl's user avatar
  • 16.1k
2 votes

Just one more pin!

You may try charlieplexing your LEDs. Using only 3 digital pins you can drive up to 6 LEDs. A web search for “charlieplexing Arduino” should get you started.
Edgar Bonet's user avatar
  • 42.8k
1 vote
Accepted

blink a Grove - RGB LED Stick

In your code, you define the global variable ledState and initialize it to the value "LOW". In the loop() function, the ledState variable is used to determine the (next) state of the LED ...
StarCat's user avatar
  • 1,607
1 vote

Make a code loop 100 times with a text on Serial Monitor

You loop() function is the one that will be called when the program runs and it will keep looping around until you stop it. So at the moment you have loop() doing the following: Reading a string ...
Code Gorilla's user avatar
  • 5,637
1 vote

How to use assembly in Arduino?

Re: "The main learning effect of this exercise is "Don't do it". You won't beat the c++ compiler..." I agree with Edgar Bonet: (1) Arduino is about learning, including learning ...
Dick Penderyn's user avatar
1 vote

How do I turn on 3 LEDs in a repetitive sequence where all three LEDs would then turn OFF when the push button used is released?

You need a state machine (to remember which LED is currently on) and use millis() to find the current time, in a loop, which is testing whether the switch is closed or not. If the switch is closed you ...
Nick Gammon's user avatar
  • 38.1k

Only top scored, non community-wiki answers of a minimum length are eligible