Hi,
I have a Arduino Unos with a continuous 360 servo. I have a RTC (Real Time Clock) emulator by Michael Margolis the Library is called "Time" v.1.5. I do not have a mosfet, resistor or hardware time clock. I'm trying to do the following below without extra hardware.
*To note:
On a continuous rotation servo, this will set the speed of the servo (with 0 being full-speed in one direction, 180 being full speed in the other, and a value near 90 being no movement).
Is it possible to do the following? Attached is my uncompleted code. It does the trigger based on a specific time just fine only if step 1 doesn't exist. If I have step 1 in there it seems to ignore the time trigger it just keeps to step 1.
How do I interrupt step 1 to run step 2?
and I can control the servo. But I don't know if it's possible to do action 2.
Any ideas?
Action 1:
Have the servo turn a wheel slowly Servowrite (80) for a long time like 9999999ms (2.7 hours)
Action 2:
Then if the time is say 9pm the. Interrupt Action 1 and process Action 3.
Action 3:
Turn the wheel faster reversing direction --Servowrite (110)-- for 2 seconds... Then do Action 4
Action 4: Hold position by using Servowrite (90 )for 9999999ms (2.7 hours)
Basically here's the crux of the problem:
When code is uploaded - I'm supposed to open up the Serial Monitor to input a epoch time like T1542739240
The problem: it does not take the epoch time because I think Action 1 is still running and getting in the way. When I comment out Action 1 then, and run the program it lets me open the serial monitor and put the Epoch time of like T1542739240
When Action 1 is not commented out, just runs and runs action 1 and don't respond to the time trigger in Action 2.
ServoTimeTrigger1.1.ino (2.63 KB)