Thank you in advance for reading this. As I am nearly at my wits end trying to make this work.
----> Basic Scenario:
Need to Interface Arduino with a device, that has 4 positions and OFF. Then cycles back to Position # 1.
So 5 button clicks Cycle the device… A Long Press Saves the ON position in case power is lost.
----> What I have Accomplished:
Power Arduino from the Device we wish to interface with - Done
Take the Devices own button, and Wire it up to the Arduino with a Pulldown Resistor - Done
Create a Homemade optocoupler using a photo-resistor and an LED + shrink Tubing - Done
Test the coupler to see if it manipulates the device, it does! 50ms blink, changes our position up +1
----> Complete Scenario
Now that I have an Interface with the original button that I can control from my Nano, I need to make it “Behave” in the following manner…
AutoButtonPress = Button Automatically records a press every 24 hours, and blinks the LED for 50ms
ManualSinglePress = After a short Pause, Blinks once for 50ms
ManualDoublePress = Resets the counter to 24 Hours
ManualLongPress = After a short Pause, LED lights for 5 Seconds to SAVE home position on the original device.
OutputToSerial = Show all actions on serial console for troubleshooting purposes
OutputCounterToDisplay = Output the 24 hour countdown to a display of some kind. To see when it is reset. As well as Status.
----> What I cannot Figure out
-
I am having a hard time understanding the Structure of the Code and how to mix all of these functions together on my Nano.
-
What Display I should Get, and How to Apply it to my Nano, and get it to display my counter.
-
How to get the counter to control the Button, and output its state to the display.
-
How to accomplish this on my Nano with as few pins as possible. (Limited Space inside the target Device.)
----> Honesty in all things… I’m a Sh_t coder, and I typically can only work from example.
But in this instance, I just cannot figure out how to put this all together.
I’ve been at this for 5 days now and I am starting to wonder if I can even do this.
Please, any help that any of you can provide would be most appreciated.
I’ve asked a few questions in Project Guidance in the past few days, but the responses are just too vague, and seem to assume that I am far more skilled in this than I am.
Nothing could be farther from the truth. Even After Days of Watching Tutorials, I just cannot seem to grasp how to put this all together.
As it sits, it appears that a combination of StateChange, BlinkWithoutDelay, Debounce, and Something Else is needed.
I just don’t know how to implement them to get to the end result.
Thank you all again for taking the time to read through this.
-Z-