Hot answers tagged

10 votes

How to use assembly in Arduino?

The Arduino IDE is quite idiosyncratic. It won't let you work on a project that doesn't have a file with the extension “.ino”. On the other hand, it doesn't care about how much code is in that file, ...
Edgar Bonet's user avatar
  • 42.8k
8 votes
Accepted

Powering up LED strip - How many amps?

Usually strips have not individual LEDs, but are composed of a lot of "pieces" in parallel, and each piece is composed by three leds in series along with a resistor. Usually the strips are composed ...
frarugi87's user avatar
  • 2,721
8 votes
Accepted

LED not blinking when using a transistor

Without a common reference (ground) between the Arduino power supply and the external power-supply, again, you have a floating base, as you can't know what the Arduino's 5v output (or local ground) ...
JRobert's user avatar
  • 15.2k
7 votes

How to turn two LED's on and off with one button?

Just use the return value of digitalRead (which is 1 or 0) as the input to digitalWrite: int btnVal = digitalRead(3); digitalWrite(4, btnVal); // On when button is HIGH digitalWrite(5, 1 - ...
Majenko's user avatar
  • 105k
7 votes
Accepted

The L LED Keeps Itself On

This is a “feature” introduced in the revision 3 of the Uno board. Up to Rev 2, the “L” LED was connected to pin 13, through a 1 kΩ resistor. On Rev 3, the same LED+resistor combination is driven ...
Edgar Bonet's user avatar
  • 42.8k
7 votes
Accepted

No power from Breadboard Power Supply Module

I'm not surprised you can smell burning. You have the power supply connected backwards. You see that little + and - symbol next to the ON/OFF jumper? That's the polarity of the two runs of pins. You ...
Majenko's user avatar
  • 105k
7 votes
Accepted

EPS8266 ESP-01: LED manipulation seems to interfere with serial communication

I would bet that the built-in LED pin is also the TX pin for the serial interface. Check here, LED Pin section: http://www.esp8266.com/wiki/doku.php?id=esp8266_gpio_pin_allocations LED Pin ...
Mazaryk's user avatar
  • 1,149
7 votes
Accepted

Infrared frequency recorded with saleae

What you are looking now is NOT the IR frequency, but the de-modulated signal. Here is what I'm talking about: (image taken from http://www.electronicwings.com/sensors-modules/ir-communication) As ...
frarugi87's user avatar
  • 2,721
7 votes

if/else on digitalRead not executing on 'else' portion

(Heh... before even seeing the code I guessed you'd done this...) You are comparing a pin number, not the results of digitalRead(), and then passing the results of that comparison to digitalRead(): ...
Majenko's user avatar
  • 105k
6 votes
Accepted

Why does an RGB LED between VCC and PWM work?

This is a common arrangement and is known as Common Anode, and the I/O pin is said to be sinking current. To better understand what is happening here it's best to think of an I/O pin as a two-...
Majenko's user avatar
  • 105k
6 votes

How to improve response time of this sound operated LED?

I think the problem is in the times you check the sensor. If you clap exactly when you check it will glow even if clapped for 1 ms, but if it checks in between two claps it doesn't detect it. So ...
Michel Keijzers's user avatar
6 votes
Accepted

Do I need a pull-up/down resistor for button LED circuit?

The circuit you have made is only using Arduino as a 5V power source. You aren't using any GPIO pins to read the state of the button or to control the LED by an output pin. You've just made a plain-...
jose can u c's user avatar
  • 6,974
6 votes
Accepted

How do I control the onboard LEDs of my Arduino Nano 33 BLE Sense?

There are 3 LEDS on the Nano 33 BLE: A power LED on pin 25 (yes, you can turn off the power LED programmatically); A built-in LED on pin 13; An RGB LED with red on pin 22, green on pin 23, and blue ...
ocrdu's user avatar
  • 1,777
6 votes

How do I make another action repeat inside a loop?

By using delay() it blocks the rest of the code. The programme needs to keep track of two buttons and update the lightshow at appropriate times, therefore a non-blocking style of coding is needed ...
tim's user avatar
  • 699
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
Accepted

RGB LED Resistance

The problem with one resistor in common anode/cathode is that when you activate more than one colour of the RGB LED, you will have additional current flowing through the one resistor which will cause ...
BartmanEH's user avatar
  • 230
5 votes

How to use a common anode 7-segment, 4-digit display?

I'll try and take you through the complete basics of LED's etc. As 4-digit 7-segment displays are a combination of multiple "LED techniques". Wiring LED's LED's, or Light Emitting Diodes, are one of ...
Paul's user avatar
  • 2,695
5 votes
Accepted

How to use a common anode 7-segment, 4-digit display?

Just as a complement to Paul's answer, I wrote a short program to show how to drive the 7-segment 4-digit display of his figure: This is actually a common cathode display, so the program assumes that,...
Edgar Bonet's user avatar
  • 42.8k
5 votes
Accepted

Not enough pins on Uno?

There are a number of common solutions to "not enough pins". Reduce the number of pins you need. This option is often discarded out of hand, but may be the best. For example, you may be able to ...
AMADANON Inc.'s user avatar
5 votes

Why doesn't my LEDs turn on?

If you are doing what is in the first picture then you're doing it wrong. You have to make sure the led is horizontal, not vertical. The signal is going through the led and not making it into ground. ...
Haras Mharas's user avatar
5 votes
Accepted

Is applying 5 volts to LED dangerous?

Different color LEDs are not the same. The are made with different impurities. And some colors (blue) were really hard to figure out. So much so that the blue LED inventor was awarded the Nobel ...
st2000's user avatar
  • 7,315
5 votes
Accepted

Need help with 2X3 matrix for braille

First of all, may I say "Thank you" for helping your friend like that? I cannot think of a better way to use an Arduino than as a driver for a Braille display like you describe! As you know, Braille ...
5 votes

Unexpected Delay Between For Loops

The claim “The cause it that your 3rd led (2nd element in the array) is reapeted twice” is wrong. Apparently that sentence is supposed to mean that the long delay is due to i being one too large, ...
James Waldby - jwpat7's user avatar
5 votes

How to run 50 IR LEDs off an Arduino UNO?

You should put a current-limiting resistor in series with each LED. You could then try to drive all of those LEDs from a beefy transistor, like a power MOSFET or a Darlington. Alternatively, you can ...
Edgar Bonet's user avatar
  • 42.8k
5 votes
Accepted

WS2812 - First are white and then they turn red/yellow/orange near the end

See Powering NeoPixels. Each individual NeoPixel draws up to 60 milliamps at maximum brightness white (red + green + blue). ... To estimate power supply needs, multiply the number of ...
Nick Gammon's user avatar
  • 38.1k
5 votes
Accepted

How can I connect nearly 450 LEDs to an arduino without drawing too much current?

First you should consider changing your whole idea so that your LEDs don't draw nearly 10A. I am assuming that for each segment you have 14-20 LEDs wired in parallel, each with its own current ...
Majenko's user avatar
  • 105k
5 votes
Accepted

Why the LED freezes? when I am adding a delay?

Your Arduino does nothing during the delay(5000). So pressing the button during the 5000 mSec that the led is off won't do anything. Or you must be very lucky to press the button in the very small ...
ON5MF Jurgen's user avatar
5 votes

How to improve response time of this sound operated LED?

Interrupts are useful for making things happen automatically in microcontroller programs, and can help solve timing problems. Good tasks for using an interrupt may include reading a rotary encoder, or ...
Joe S's user avatar
  • 151
5 votes

how to connect 100 Leds and Blink them on Arduino

For 100 LEDs in parallel you will also need 100 resistors, and a transistor (MOSFET) that can handle the total current for all the LEDs. For instance, at 20mA drive current you would be dealing ...
Majenko's user avatar
  • 105k
5 votes

Individually addressing LEDs in a multiplexed matrix

Thanks to KIIV in the comments I figured it out. Apparently the trick is to rapidly switch between columns or rows without ever having two on at the same time. With the below code running in the ...
Coding Flow's user avatar

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