Hey Everyone. I have been trying to create code for this for some time but I just can't seem to get it all to work how I'd like it. It would be for my scooter which lacks any real advanced electronics
I know I can't use delay since I want multiple functions and although I've had minor success getting somethings to work the moment I try to add cancelling abilities everything breaks and that's with just one of the 3 buttons so I know I'm over my head. So I'm hoping someone can take on this project for me.
Here is the basic scope of what I would like to do:
Scope. Emulate turn signals and brakes (with additional features) using momentary buttons.
3 Buttons
1: Left Turn Signal
2: Right Turn Signal
3: Brake Switch
Basic Turn Signal Functions:
Short press makes the light blink a pre-set amount of times. i.e. 5 times, press duration less than 500 ms
Middle length press turns on signals for pre-set number of flashes i.e. 20 times, press duration greater than 500 ms less than 1500 ms
Long hold flashes both left and right lights flash until cancelled. Press duration greater than 1500 ms
If left side is active for any function and left button is pressed again for any duration it should cancel current function and not trigger a new one for that side.
If one side is active and the opposite side button is pushed, cancel current side and do the function of the new side based on the press length.
Advanced Turn Signal:
If brake is pressed or being held while the middle length is active/activated (20 flashes) the flashes reset and not count down until the brake is released.
Brake Button:
When pressed the light should flash rapidly for pre-set amount of time i.e 5 seconds then go solid until released.
Of course the number of flashes, the trigger times and the duration of the flash and timing will all be subject to adjustment during real world testing.
The basic setup should work on an UNO but I may use something smaller once I figure out the all the electronics such as flasher or relays. That part I'm not worried about and have a ton of 12 volt electronics experience. If I can get LED's on the Arduino working I can make them work on a scooter.
Analog input I think would be best since it will be triggered by scooter turn signal and brake switch. Both switches are 12 volt output. All lights will be converted to 12 volt LED. But I don't know what works best for Arduino so open to expert suggestions.
This is a personal project so please be kind on quoting costs