casainho
10 GW
- Joined
- Feb 14, 2011
- Messages
- 6,058
NRF SDK already has a queue library, did you check it?beemac said:rananna said:@casainho,
For the remote I fixed the latest bugs , updated the docs and submitted a release candidate Pull request for your testing.
@casainho & @rannanna
I had a bit of time today and thought it would be nice to actually write some code instead of copy pasting and bug fixing!I wanted to put some led control in the wireless controller - as it would be really useful when running headless or if the phone is in your pocket (and you don't have a remote of course!). I didn't want the led sequences to block - so I've knocked up a simple led sequence player that can be clocked at whatever rate we want. It works ok - but haven't done a pull request as it needs a bit more testing - and I need to create all the sequence definitions from rananna's docs.
https://github.com/4var1/TSDZ2_wireless/blob/led-alert/EBike_wireless_TSDZ2/firmware/ledalert.c
You can queue up led sequences with a single call - and let it get on with it.
If I get some more time later I'll post an exciting video...
Also we need to set LED PWM value and not only on and off, because for instance the green LED is to strong - it is hard to the eyes, I really need to less strong, maybe half of the power. For example current blink for assist level seems like a flash but I wish it to be half that strong but twice the time.
Also I would like to understand the power impact -- the TSDZ2 wireless firmware should follow the same ideas as the remote, to save power.