Timing LED challenge
Task
Blink at least 3 LEDs at the same time.
Each LED should blink at a different interval. For example the first LED blinks every 200ms, the second one every 500 and the third one every 900.
Rules
-
delay()
delay_ms()
or any similar delay functions are NOT allowed.
- millis()
, micros()
and similar are allowed.
- the blinking has to be visible to the human eye.
- No external libraries. (Arduino functions like millis()
are allowed. External definitions like avr/io.h
are also allowed.) If you wrote the library yourself then it's allowed.
- No cheating by looking at code from previous winners!
Bonus Challenge
- No (or almost no) duplicate code for each LED.
- Adding a LED requires changes to 3 or fewer lines of code.
- Or Adding a LED requires changes to only one line of code.
- Changing the interval of one LED requires changes to only one line of code.
- Intervals of all LEDs can be set completely freely to any millisecond (or higher precision) value
- Intervals/duty cycle of all LEDs can be adjusted completely independent of each other
Stuff
- Feel free to ping me for any questions.
- Please ping me with your solution.
- (If you post in this thread I will see it. No ping necessary.)
- I recommend to use wokwi so you can easily share your solution.
Winners
- in pinned message https://discord.com/channels/420594746990526466/1205162164344848395/1207461901353750568
214 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
But
0x1
is the same as 1
and 2 characters shorterUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
both should yield an integer constant, just written decimal or as hex
I think it should work
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
edit it 😄
Nice solution. Just you can't completely freely choose the intervals. And it slightly bends my Bonus Challenges about only having to change limited number of lines to add LEDs or change intervals 😆 🥳
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
exactly
I just added a new bonus challenge because of you
but should get "Most Obfuscated" award 🙂
(and that is meant as a compliment btw)
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
hey, it works! had to format it "properly" to even begin to figure it out 🙂
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
pretty soon the rules will be much longer than the codes
hehe
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
bing image creator AI
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Does this have anything to do with this led challenge?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes, variables declared inside a function:
- get created when the function is called
- can get used inside the function
- get completely destroyed when the function ends
-> when the function is called a second time, the variables get created again. So their values don't "survive" between multiple function calls.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Exactly
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
you could think about just creating a class then. An object (class) is basically "Variables + functions that can use them in one neat package"
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Sounds good 👍 feel free to ask more questions here (that come up as you work on the led challenge )
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Sadly I learned the basics in school so I don't know about the internet. I can say though that for general C++ reference stuff Microsoft's C++ reference is way easier to read and less formal than cppreference.
I don't know a good classes/object oriented tutorial right now
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
You know this syntax to increment a variable by one?
C++ was named c++ because it increments c.
It's almost just a bunch of stuff added to c. Basically 99.9% of c is still "inside of"/included in c++.
"Almost" because there are very few exceptions. Afaik when C++ was created it contained all of c. So it was just an extension and everything that you could do in c you could do in c++ exactly the same. But after the creation of C++ a few small things were added to C that weren't added to c++. You most likely won't stumble upon those exceptions.
I'm not sure if there are other changes or things that got deprecated.
Nowadays there are also things that you can still do in C++ (because you could do them in c) but where the old c way is discouraged in favour of a more modern C++ approach.
Like c-style casts vs modern c++ casts.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes. But you have to include its entire source code here, as file in wokwi or as link
Lmao how often I "have to" adjust the rules
Would definitely be interesting to see how you wrote such a library
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
The first idea for this challenge was to teach people
millis()
or cooperative "multitasking" but now I'm also curious about various other solutions 😄 So sure use hardware timers 👍Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
you wired the LEDs to 1,2,3 but in your code I see 2,3,4 Not sure if the timer stuff is right. I always had to debug that myself with the simulator in atmel studio 😆
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
And I don't know what timers Arduino already uses
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Oh really. Weird. Maybe wokwi doesn't simulate it right. Could you post a quick video? 😄
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Nice 👍 🥳
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
exactly
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
👇 Winners 👇
Winners
- AnonEngineering with a simple classless implementation https://discord.com/channels/420594746990526466/451155334845693952/1203776679823020063 and https://wokwi.com/projects/388825844131388417
- Me with an object oriented and slightly confusing solution https://wokwi.com/projects/389196557188321281
- Greeniac with a very short (and most obfuscated) solution https://discord.com/channels/420594746990526466/1205162164344848395/1205560932764356648 https://wokwi.com/projects/389274055915569153
- Lorbasta with a hardware timer/counter to create "ticks": https://discord.com/channels/420594746990526466/1205162164344848395/1207312024149692476 https://github.com/pastadozembow/SillyHardwareTIM-3/blob/main/main.cpp Video: https://discord.com/channels/420594746990526466/1205162164344848395/1207314770970148924
- jim lee using his own library LC_baseTools https://discord.com/channels/420594746990526466/1205162164344848395/1207380811083423774 https://wokwi.com/projects/389726049725583361 Library: https://github.com/leftCoast/LC_baseTools
- Exodus with AVR Hardware timer 1 and its compare and overflow interrupt functionality: https://discord.com/channels/420594746990526466/1205162164344848395/1207547816923111534 https://wokwi.com/projects/389784331600601089
- Wasted with a neat nbdelay class in a separate file using a slightly different millis() calculation to reduce drift over time https://discord.com/channels/420594746990526466/1205162164344848395/1207665654438825994 https://wokwi.com/projects/389806431434073089 https://discord.com/channels/420594746990526466/1205162164344848395/1212028652729147402 https://discord.com/channels/420594746990526466/1205162164344848395/1208231810505379900
- dmitrii with a basic class-based solution that blinks the LEDs very quickly. video: https://discord.com/channels/420594746990526466/1205162164344848395/1211095126081015949 code: https://pastebin.com/dMSN9ZGV https://discord.com/channels/420594746990526466/1205162164344848395/1211096677285625866
- Amirreza Ipchi-e-Haq with a very short solution using a division and modulo "trick" https://discord.com/channels/420594746990526466/1205162164344848395/1240680083132256376 https://wokwi.com/projects/398052607831117825
- Icesythe 7 with maybe the shortest solution possible https://discord.com/channels/420594746990526466/863150029182206002/1253833268361691226 https://wokwi.com/projects/401341105758781441
- WeeGee with an actually even shorter solution https://discord.com/channels/420594746990526466/1205162164344848395/1264345669586649128 https://wokwi.com/projects/403969026122782721
- WeeGee again with bending the rules and adding external components. Shortest loop ever? https://wokwi.com/projects/404871112473916417 https://discord.com/channels/420594746990526466/1205162164344848395/1267960439057285174
- DungThrower https://discord.com/channels/420594746990526466/451155334845693952/1268738081813430273
- Marc with an array-based solution https://wokwi.com/projects/413146789837197313 https://discord.com/channels/420594746990526466/1205162164344848395/1301071179326554124
- zombean with a struct and function pointers https://wokwi.com/projects/413344853374775297 https://discord.com/channels/420594746990526466/1205162164344848395/1301848393685008385
reserved message more bing ai penguin

Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Might be hard to add a fourth LED to that but still very nice 😆
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
very nice!
Made a wokwi for it: https://wokwi.com/projects/389806431434073089
Wokwi
Timing LED challenge by Wasted - Wokwi ESP32, STM32, Arduino Simulator
Run IoT and embedded projects in your browser: ESP32, STM32, Arduino, Pi Pico, and more. No installation required!
interesting variant of the blink without millis. The way you solved it doesn't cause drift if nbd() gets called a few milliseconds too late sometimes.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Very nice! thanks @WasTested Now I'm wondering for what application which approach would be better 🤔
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I don't think you want previousMillis to be static 🤔
static variable = all objects of the class share this variable. You could think of a private static variable as a global variable that only objects of the class can access.
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
variables declared inside of a function get destroyed when the function is done
variables inside of a class survive as long as the object survives. If your objects are global then all the variables inside the objects survive as long as the arduino stays running
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Functions inside of a class can just change the variables of the class
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
use pastebin.com, paste it there, post the link it gives you here
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
👍 👍 Nice! Is it on purpose that they blink on so short? 😄
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
next question 😄 Is it on purpose that you don't update previousMillis in the else if?
With the current code I think that
timeTheLEDActuallyIsOn = delay - duration;
. If I increase LEDduration to something large like 500 then LED5 never turns off. Even though it should be off for 461ms and on for 500.0
But over all very nice! You're definitely getting there! I bet you learned a lot that you can use in various things in the future!
Otherwise the code works. Just some ideas, you don't actually have to implement them:
1. Every time you call .Blink you have to enter all 3 values, the pin, the delay and duration. It's always the same. You could consider storing those 3 in the class/object. Maybe make a constructor that takes those 3 values and stores them in the object.
2. You enter the BPM and calculate the delay. 5 times. In 5 lines. Maybe you could add that to the class? For example a function setBPM(int bpm)
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
nomination for most overengineered solution 😄 👍 👍 💯
orange is the new smart solution with minimum pulse width and blue is?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
ah 👍
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
🥳 Link or it didn't happen 😝 😄
Very nice!
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
wow that's short 👍
but what
very interesting and nice actually 👍 I just don't really like the pinMode in the loop but 🤷♀️ 😄
it is very nice, but let's not use it to replace "Blink" to demonstrate to noobs 🙂
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
You can of course change things or have multiple solutions:D
Unknown User•16mo ago
Message Not Public
Sign In & Join Server To View
@Icesythe7 made me aware of this challenge, and I wondered where this solution stacks up in the runnings for the tiny/obfuscated class of solutions:
https://wokwi.com/projects/403969026122782721
The entire code:
void setup() { DDRD = 0xFF; } <- setup
void loop() { PORTD = millis()>>8 & 0xFF; } <- loop
it's def a "technically" but it works!
-Blinks up to 8 LEDs at a time
-all 8 LEDs guaranteed to blink at a different interval
-no duplicate code for each LED; two lines for all
-very visible blinking
(wow I just realized this is a mega necropost, my bad )
I guess I was also spoiled by Icesythe7's answer, which gave me the idea of
a binary counter
I'm always happy when this continues! 😄 🥳
Oh neat!
So does this solution pass the requirements, as a double check to my work?
A bonus challenge could be added for the duty cycle of each LED; mega bonus for being able to change the on and off time independent of each other
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
added you to the winners! I absolutely love it! Very creative! 💯
I didn't add that bonus challenge (until now) because I didn't expect a solution like yours 😆 👍
Ayy, glad to hear it's not completely outside the spirit of the challenge :P
the spirit of the challenge is to have fun!
and maybe learn something or try something out
Oh I just had another interesting idea 👀
do it! 😄
here is a submission that goes for 2 specific bonus challenges (hidden for spoiler)
How it works: this uses a maximal cycle length linear feedback shift register of length 8 to blink 8 LEDs in a "pseudo-random" cycle.
-The blinking is visible to the eye
-no use of
delay
but I bashed millis
around to be a pseudo-delay, which might be outside the spirit of the challenge (it's in Setup though and only runs once, which might be OK?)
-adding more LEDs requires no additional code at all, for a theoretically infinite number of LEDs! (bonus challenge 1 and 2, I think?)
(but requires adding more XOR gate "taps" and 595 shift registers for the cycle to be max length)
-LEDs blink pseudo-randomly (about as random as the RNG of many NES games--hint!)
-After startup, at least 1 LED is always on, guaranteed!
Notes about this specific solution:
Since the 595 has a data register for the output, the taps (except for bit 7) needed to be offset to the bit 1 before
The OR gate is simply there for the Uno to seed the initial required 1
bit into the register (state 0b00000000 is forbidden, and this cannot recover from it)
Could simplify by using a Nano and setting the fuse for it to output it's clock onto a pin, and then use hardware (d-flip flops) to divide that down to a visible frequency-- would be "zero" code!
I've not yet verified that the cycle length is maximal; i.e. that I made no mistakes in wiring. Could be verified in software by reading the 8 output bits of the 595 shift register with GPIO or smth and checking that all 255 states (not zero) are reached
Inspired by the look of @ShadowsInTheSky 's solution above, which coincidentally looks a lot like the example on the Wikipedia article for linear feedback shift register (not the same underlying mechanism between these two though)
Link to said wikipedia article: https://en.wikipedia.org/wiki/Linear-feedback_shift_registerUnknown User•14mo ago
Message Not Public
Sign In & Join Server To View
big fan of the
?
operator in the digitalWrite
line
I'm curious how this handles the overflow of millis
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
wtf
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
gonna add a new bonus challenge: no external hardware 🤣
but actually no. External hardware is fun! 😆
so no 595s to control more LEDs than GPIOs? darn :P
(wouldn't an LED be "external hardware"? guess we gotta make-do with the RX, TX, and LED_BUILTIN :P)
there are probably a lot of ways one could "trick" the challenge with external hardware 🤔
simplest would be with those LEDs that have the built-in flasher chips; they tend to drift anyways
lol
so you'd get randomly blinking LEDs with just applying power
that would be cheating though
it would!
reminds me of BigClive.com's Supercomputer panels, which are exactly this
could exclude these from the challenge though because they techically have the entire set of code reqiured for each MCU in each LED, which I'd say counts as quite a few lines per LED :P
-> duplicate code
lmao
well played
this makes me think it'd be a neat bonus challenge; ensure that the timing for the LEDs is rock-solid stable even when
millis
or micros
overflowatomic clock time
I wonder if Wokwi would be fast enough to make an entire CPU out of effectively LUTs and D flip flops
just make your own ASIC for blinking LEDs, lol
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
What if
interval
is not a modulo of ULONG_MAX (or whatever that constant is)?
Say that the modulo would have rolled over right at ULONG_MAX+1, but it doesn't because millis
overflows?
Wouldn't that mean that the delay there would be nearly 2 whole interval
s?
Ah forgot to ping, my bad. See above; what about odd modulo for the overflow?Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
This shorter solution is definitely better if you just want to blink leds say, I strongly agree
Some kinda tracking is required though if you want to keep consistent intervals, which sucks
(Something like previous millis, or setting a "next millis" target by adding to
millis
, requiring either repetition or adding some kind of struct/OO thing
Iirc blink without delay doesn't even fully handle it right since it adds the offset to current millis, not the target, so it can drift by a lot over time if the code consistently misses the "deadline" millis by 1 or 2
Don't you need to have a * - & pair in order to pass the previousMillis by reference?
i.e. a * in the function def, and dereferences wherever it's used, plus an & in the function call to get the address of?
Or am I failing a C/cpp syntax check hereUnknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Or instrument it in simulation and run the simulation at 5000x realtime :P
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Ok fine-- 50,000x realtime
(But yea the instrumentation step would be more time than that)
Could just leave it as a warning to the user; "timings may be 2x the length every 5 months or so"
May be up to*
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
I've heard something like "90% of embedded development is easy; it's that last 10% that really gets ya"
I think this specific challenge nails that 10%
leftpad
moment (although that's more an indictment(sp?) on npm than the og dev of leftpad)you can create your own IC in wokwi and program it 😆
first solution
second request
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
So I don't forget it: https://discord.com/channels/420594746990526466/451155334845693952/1268738081813430273
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
on what type of board?
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
I have some code for you to test on a scope please?
Unknown User•14mo ago
Message Not Public
Sign In & Join Server To View
Dang, even with direct port manipulation?
I wonder what this is an artifact of;
the timer being preset to a power of 2?
something else bound to a timer?
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
@WasTested I fear you're tring to force crayons to create fine art.
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Is "Was Tested" an omage to Adam Savage?
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
btw I haven't forgotten about y'all. Will update winners and such soon 😄 And I always love new entries, discussions, ideas
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Fitting an entire
malloc
on an mcu with no mmu would be quite somethingSounds interesting, so yes definitely allowed! 😄
And doing it just to blink two LEDs 😆
Hey, it's a hard problem!
Especially to so without preventing other things from functioning, or using up a ton of peripherals (timers, interrupts, etc.)
Technically isn't an RTOS just the endgame solution for this challenge, anyways?
I suppose yes 😄 but the other endgame would be making the solution as tiny as possible so no rtos
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
That should all be laid out in some doc that goes into detail on the ABI, application binary interface iirc?
It'd probably be easiest to find it searching for asm<->c interop documentation, things like register calling conventions, argument passing, caller/callee register saving, etc. etc.
The implement of malloc on avr is actually pretty interesting imho
If you make your own malloc, the easiest of course is just a straight slab allocator; helps with issues of memory fragmentation, but is a limiting paradigm to work with, and iirc doesn't play nice with naiive things that malloc teeny tiny things often?
It's basically a linked list that is stored in the unallocated memory pointing to the next unalloyed memory block iirc
It'd be interesting to see the full def of the nodes of that linked list
I've messed with C structs trying to do unknown length members, but it seemed to go counter to most of C's guiding principles
I think the node is just at the beginning of the unallocated block. Contains size of this block and pointer to the next node&block
But I could be totally wrong I read that like last year and am on my phone now
that sounds reasonable though
since it's possible to do the whole append/insert/remove, and the linear time allocation doesn't matter too much as long as you're not allocating super tiny things
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
Very cool! Thank you everyone for continuing to do this challenge!
Unknown User•11mo ago
Message Not Public
Sign In & Join Server To View
➕ Gave the role Trusted to
zombean
➕ Gave the role Trusted to _wee_gee_
wait why did I get the trusted role... in this channel? ._.
caus your awesome? nad trustworthy?
oh no I think I understand the trusted role, maybe, but it being given in this channel threw me lol
Am I too late to submit?
https://wokwi.com/projects/415790157081086977
Wokwi
LED Challenge - Wokwi ESP32, STM32, Arduino Simulator
Run IoT and embedded projects in your browser: ESP32, STM32, Arduino, Pi Pico, and more. No installation required!
Honestly it was very easy
Made another version in which you can adjust the delay of each individual LED with a potentiometer
https://wokwi.com/projects/415791069211394049
Never too late! I'm always happy about more submissions. Will look at it later when I'm not on the phone any more
I see why so many people go for the nice object-oriented approach for this; the only real difference between the 3 LEDs'
timer
functions is the millis comparison, the toggle
function, and the state variables like millis2
Feels like it'd be a good spot for a struct with function pointers or something tbh
With the almost duplicate functions, I do wonder how much flash this'd take to blink as many LEDs as a Mega has gpio 🤔
Probably still insignificant honestly
copy-pasting is easier to read though if you're not used to structs or suchhttps://wokwi.com/projects/415872063559778305
Made another one, to be honest it is hard to work with pointers and references so I used something else
Idea: Make a ranking or selection of winners in terms of "which solutions are the best for beginners to copy when they need to do multiple things simultaneously"
@PenPengu I'd like to propose my solution. Wonder if you can find out how it works 😄
I want to tackle some of the bonus challanges aswell.
Does my current solution break the rules of "no duplicate code"?
A0 is floating? You use the AC noise as "clock" for the LEDs?
Exactly 😄

amazing idea
I measured it and it was 1-2% accurate. Only drawback is that the smallest timestep it 10ms (50Hz AC, both triggers on falling and rising edge). Maybe a diode could be added to prevent negative voltages on A0
Wow. I wouldn't have gone this far for this but that is innovative
Only took me a couple minutes of coding. I already had the idea for the code in my had (And like 5 seconds to check the ports)
or you could use INT which can trigger on falling or rising edge only
or use PCINT and then inside the ISR, read the pin to figure out if it was triggered by rising or falling.
But to get a fast clock, triggering on both edges seems actually good
stupid idea that I had:
Region lock DRM for your arduino sketch. Measure the frequency of a floating pin and then only allow the program to execute in north America where the frequency is 60Hz 😆

It could check the frequency for 5 seconds in the setup using a known timer like millis and then adjust to that. But yeah it could be used for what you said haha
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
the main idea behind this challenge was teaching people how to use millis to multitask an arduino. 😄 But now people have found many more very creative solutions
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
hey! mine used
millis
to great effect!
I didn't need to store any funky variables, either :P
(I wonder if a solution that uses millis
and something like double-dabble could make a fast solution that uses negligible memory per new LED?)
I might need to make that a thing after exams
wow, even a regular integer division of bytes is painful on an atmegaUnknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Here is a new challenge for you all.. Something I saw on the Arduino forum.
Hookup a RGB LED. Can be in simulator. Using the same rules as the original challenge, run the LED from red to green and back. Overlapping 1/2 of each color with the next. Be able to vary the frequency while it's running. The light should look something like this..

The results of that working properly will be pretty!
I actually made that once with an RPi and a sense hat but with 3 colours
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
Took advantage of integer overflow

@ShadowsInTheSky @juan very cool! If you have wokwi (or similar) links for it, please post them 😄
Here's the project: https://wokwi.com/projects/418711710343989249
how did you do that graph?
The serial plotter, when you output serial data it shows the button below the serial monitor
oh lol I never tried that with wokwi 😆
Ok, here's one.
https://wokwi.com/projects/418919140773841921
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
no
In fact, if you have a creative solution that only works on a specific arduino then it could be even more interesting 😄
Also... you might want to add a little explanation to it. Like that you are looking for help with your coding.

Still nothing. Also please remove the old links
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
Still doesn't work for me
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
So, now the link works
Did you look at the requirements? You are not supposed to use delay, repeating code.
Also in your hardware you have no current limiting LEDs. Plenty of ways to improve, you can look at the other's solutions
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
Defeats the purpose of having requirements if you just ignore them. But if you don't want to improve, then sorry but we can't help you
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
To improve your coding use millis()
See files -> examples -> basics -> blink without delay
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
those giant explosion symbols are fun though...
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
afaik this is ongoing and open as a self-challenge
dumb ideas welcome, so long as they try to meet the spirit of the challenge and aren't just someone else's code or something.
Always up for interesting ideas
the "spirit of the challenge" being "challenge yourself by making LEDs do the requested stuff without common coding pitfalls" with a bit of "see how much you can game the requirements and still be within them"
timing led challenge is always open to new solutions! 👍 😄
WeeGee 100%
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
You are so close, you should pack that into a "smart LED" class. The rate of flashing would give you an idea how fast the rest of your code is running.
Cool, would be cooler if the current limiting resistors were not missing 😭
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
You're a fast learner 😉
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Looks great, interesting and new approach! Have you thought about tackling the variable duty cycle and "single line add an LED" part?
Unknown User•4mo ago
Message Not Public
Sign In & Join Server To View
Yes you're right. It's the relationship between the length of a cycle and the portion that it's on for every cycle. (Almost like on - off ratio. 20% duty cycle means 20% on, 100-20= 80% off)
PWM varies the amount of time the signal is HIGH, the more time a signal is high the more power is delivered to the load. In this way an "analog" output can be simulated, it isn't truly analog, the signal is only HIGH or LOW, but the power varies.