Good day,
i'm quite new in arduino programming, and definitely not a pro
My aim is to use a arduino micro or a digispark to drive (via a dedicated battery and mosfet on output(s)) a 12v yellow strip led (not RGB) in a variable flickering sequence depending on the rc remote throttle lever position.
i dont want the neopixel rgb strips as i dont like the colours nor the power they produce.
i have spent some hours reading different projects trying to figure out what kind of instructions i need to do so, but the more i read the more i got lost i have no problem with the wiring or technical things, i need help on the program itself
my aim would be :
in function of pwm signal input from rc receiver, standard 1000-2000us , get 5 "periods" (for example <1300us/1300-1500us/1500-1700us/1700-1900us/>1900us) to which i could assign a corresponding flickering sequence to output(s), no output when no pwm signal.
i saw different functions/methods for the "periods" and the "flickering sequence".
using pwm to dim the led (short on/off cycles like candle effect)) insteads of long ones etc
OK...
Could you tell me more about this solution ?
I also have brushed esc which works more or less, but no flickering , and we can't see well the led in daytime when half of power, so better full power pwm/flickering.
Also I would have liked to learn a bit about arduino that's was the goal of this project as well
Find or write one sketch that makes one LED do anything like the five different things you want to do ultimately.
It sounds like you could start by wiring one LED and series current-limiting resistor to an Arduino output and learning how to make it blink.
Use any Arduino board. Worry about making it cool and small when more of what you want to do is working.
Blink an LED? There are examples in the IDE, work your way up to "blink without delay".
Most of the examples will point to web pages that go into some detail about how what you are seeing is informed by the sketch that is running.
When you have written or found the functions that make the effects you want will be time to worry about controlling it with the output fro your receiver or wherever that 1000-2000 servo pulse is coming from.
Thank you for your answer .
My problem is writing this sketch, not wiring the test led... As I said in my question .
My Problem is how to write a proper arduino code and to use properly and in an efficient maneer all the arduino options (maps intervals , interrupt , loops etc)
This, and all your effect blocks, won't do anything. It will just turn on both LEDs.
digitalWrite() turns on the LED if the second argument is not zero; the assignments at the top of the loop guarantees it is not zero so the LEDs will be on.
Provide a link to where this code came from or what you based it on if you wrote it. It looks like nonsense to me.
Still looking in different forums to find informations, I will have more time from tomorrow
For now I couldn't try as I don't manage to connect my digispark to my computer (not seen as USB device...) I ordered an arduino micro but I'm abroad for my job for now so I only have the digispark wired with led from which I expected to be able to make some testing in my hotel room😅