New answers tagged

-1

Yes, the led will glow because a standard led can withstand up to 5v maximum which matches the power given by the Arduino.


1

Detecting the LED Pulses You want to detect each LED pulse. For this you will need edge detection code. There is an Arduino example built into the IDE and information describing the function here: https://www.arduino.cc/en/Tutorial/BuiltInExamples/StateChangeDetection To add to the Arduino explanation, you can either detect the rising edge (ie. the ...


0

I am not sure where you are getting your LEDs but the ones I purchase do not survive 5 volts. You need to put a resistor in series with then, something in the 220 to 510 ohm range. When you get some resistors test your LEDs you may have damaged them as well. A good indication of this if there color if obviously off and or dim. If the timers are set up ...


2

Ok. First off, if you have a 12V LED strip then you have to power it from 12V. Powering the Arduino from 12V and then powering the LED strip from the 5V pin of the Arduino is not powering the LED strip from 12V, it's powering the Arduino from 12V and the LED strip from 5V. The LED strip's anode (+) must be connected to the + of the 12V supply or, if it's ...


3

Great thanks to Ananas_hoi, I was finally able to get my code work accordingly!! The following code only show the 4 LED to be lights up one by one every second when the button was pressed and hold: int current; long millis_held; unsigned long firstTime; byte previous = LOW; const int buttonPin = 13; void setup() { pinMode(buttonPin, INPUT)...


2

Your problem is your usage of sizeof(). It doesn't do what you think it does. sizeof() gives you the amount of memory a variable takes up. It does not give you the number of elements in an array. For example: const int ONE[]={2,6}; sizeof(ONE) will not give you 2. It will give you 4. An int is two bytes in size (16 bits). An array of 2 ints is, therefore, ...


3

There are multiple errors in your code. In the loop, the first if might not have the use you intended it to have. You are checking for previous == low, but you never set previous to high. Therefore this check can be removed entirely, or you could restructure your code a bit and add a previous = high. Secondly, this if is also flawed: if (millis_held >= ...


0

Here you declared keypressed as a variable, so you need to assign an input to it using 'keypressed = serial.read()' without quotes before if statement in void loop. Note make make use of serial monitor for input and also assign 'serial.begin(9600)' without quotes in void setup function before pinmode statement.


0

Or just use the MAX7219, specifically designed for 7-segment displays. It has an operating current spec of 330 mA, good for all segments and the decimal point on at the same time. A four-digit 7-segment display with a total of 32 LEDs allows 10 mA per LED assuming you have everything on at once. Am I missing something? Frank


Top 50 recent answers are included