Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

5

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) looks like to the external circuit. Connect the two grounds. That should correct the LED brightness with respect to the Arduino output pin level. Then, if you ...


2

your for() loop should end with with either "i=i+1" or "i++" or "i +=1". In your code you are just saying i+1, which doesn't actually affect "i". So the first loop continues endlessly, and the "voltage" variable (which should not exceed 255) continues to go into the "illegal" range. The arduino likely translates the illegal values to 0. Eventually, since '...


2

A good way to start debugging this sort of problem is to print out debug statements that say what the hardware should be doing. If the debug statements print out as expected then it's probably hardware, if not, then it's probably your code, e.g. if (percent < threshold){ Serial.prinln("LED on."); digitalWrite(LED_BUILTIN,HIGH); } else { Serial....


1

Lets start off with a flow chart: simulate this circuit – Schematic created using CircuitLab To implement this I suggest you combine the Button example with the Blink Without Delay example. For this program you don't want to blink but instead turn the LED on for a set time without using the delay() function. If you are finding the task too hard ...


1

As Wendall says in his comment, you probably have an issue with the power-on state of your logic pins before the Arduino finishes booting up. In addition to that, you should not drive a relay directly from an Arduino logic pin, for a couple of reasons: It can't provide enough current to drive a relay coil. The relay emits a strong surge of reverse current ...


1

Your question is awfully vague. There is a protocol called I2C that's commonly used for microcontrollers. It's a serial bus that has a data line, a clock line, power, and ground. That might meet your needs. Each device on an I2C bus is supposed to have a unique address. You send commands to it using that address, and it doesn't matter where it is located ...


1

Keep interrupt shorts Inside an interrupt, do not use long pauses, thus not a delay. As chrisl notes below (see comment) delay does not even work inside an interrupt, since it is based on millis(), which are not updated within an interrupt. The reason is that interrupts should be as short as possible (so even if you would use a for loop with micros() or ...


1

You have a lot of LEDs that you need to power so lets run through the calculations. Assuming that they are RGB LED strips, ie 3 LEDs per physical LED: 5 x 60 x 3 = 900 LEDs Assuming each has a current draw of 20mA, that is (900 x 20mA) 18A of total current if all are on at the same time at full brightness. Since each colour will be controlled by its own ...


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