Hi,
i am new here and i am better in CNC-programming than in Arduino. I made a model of the Television Tower in Berlin ( see atteched photo) with 5 LEDs , one on the Top, one in the spinning ball and three on the buttom.I am having a trouble in running two Loops at the same time, one for the LED on the top( On-Off Loop with 1000 Millis delay) and the other Loop for the rest LEDs( constant On-Loop).
I know that i can not use Delay because it means running one Loop each time and i am at a dead end with my very little Know-How .
SAMRalbayati:
Hi,
i am new here and i am better in CNC-programming than in Arduino. I made a model of the Television Tower in Berlin ( see atteched photo) with 5 LEDs , one on the Top, one in the spinning ball and three on the buttom.I am having a trouble in running two Loops at the same time, one for the LED on the top( On-Off Loop with 1000 Millis delay) and the other Loop for the rest LEDs( constant On-Loop).
I know that i can not use Delay because it means running one Loop each time and i am at a dead end with my very little Know-How .
Any help is much appreciated
Samr
For just the 1 blinking and others ON you can keep your delay but if you would do more, first learn to time with millis() and save yourself a lot of work.
But for this... the leds that stay on, turn on in void setup() and they stay on until you turn them off. If you don't turn them off, they stay on.
And in void loop() you have the things that change, your blinking light.
wvmarle:
But why even using an Arduino for this? A 555 in astable mode for the blinker, and power to the other four, and you're set.
That would certainly reduce the cost of the parts. But if you know nothing about 555 timers and if you take account of your time it may be more economical to use an Arduino. And learning to use the Arduino might be beneficial for other projects.
Same accounts for learning the 555, possibly the most produced ic in the world. Not that hard to learn. The hardest part I had was getting it to a 50% duty cycle, but even that can be done.
Not when the charge/discharge resistance changes all the time (which in my case it does - using it to measure the EC or a liquid). And even with a diode you can't get to 50%.
Use the output of the 555 to charge/discharge the cap and you get an exact 50%. I had to take some extra measures, though, as the resistance can drop to about 10 Ohm and the 555 can't deliver that kind of current.