Skip to main content
Arduino

Timeline for How to Independently run positional and continuous servos using millis()?

Current License: CC BY-SA 4.0

14 events
when toggle format what by license comment
Jan 15, 2022 at 12:43 vote accept Emlinux
Nov 22, 2021 at 10:27 comment added Emlinux @EdgarBonet I just flipped (milliSNow - lastTimeServoRotate) check from 10000 to 3000 and it run. (milliSNow - lastTimeServoRotate), this checks the time elapsed time. But when start, it wait for 10s to run, even I set it to check with >= 1000 (~1s), I didn't get it. Please suggest.
Nov 22, 2021 at 7:33 comment added Emlinux @EdgarBonet Thank you. I uploaded it as 'Trial code', Could you please check it? since its working but the fw/rw run time is 3s instead of 10s and holding time is 10s instead of 3s though i defined it to run for 10s and hold/stop for 3s. where I am mistaking? please suggest~
Nov 22, 2021 at 7:27 history edited Emlinux CC BY-SA 4.0
added 1268 characters in body
Nov 19, 2021 at 9:19 comment added Edgar Bonet Re "I wish to hold/wait for 3s after 10s FW and 10s RW run each": This is not in your code snippet. If you want these pauses, you have to explicitly ask the servo to stop, and your cycle has four phases: FW, pause, RW, pause.
Nov 19, 2021 at 8:51 comment added Emlinux @EdgarBonet Thanks for your comment. This code works to run CR in this manner.. 1. when start, it run after 10s 2. servo1 run for 10s FW then immediately run for 10s RW in loop. but I wish to hold/wait for 3s after 10s FW and 10s RW run each. 3. 'lastMillis' is only used for CR servo, its not clashing with POS servo variable.
Nov 19, 2021 at 8:32 comment added Edgar Bonet The last code snippet you posted should work, albeit with 10 second (rather than 3–4 s) pauses between FW and RW. If it doesn't work, you have an issue elsewhere in your code. Maybe you are sharing the lastMillis variable with the code handling the positional servos?
Nov 19, 2021 at 3:36 history edited Emlinux CC BY-SA 4.0
added 420 characters in body
Nov 11, 2021 at 9:33 history edited Emlinux CC BY-SA 4.0
added 757 characters in body
Nov 11, 2021 at 3:48 comment added Emlinux @ArduinoFan thanks for sharing the link, I tried this but this is for controlling same type of servos, in my case i need to set up positional servo and CR as well, so its getting mixed operation. while running pan/tilt one after another with continuously running CR servo CW/CCW with wait time of 2s. any help would be appreciated. Thanks.
Nov 11, 2021 at 2:46 comment added ArduinoFan arduino.stackexchange.com/questions/83977/…
Nov 10, 2021 at 9:34 answer added Edgar Bonet timeline score: 4
Nov 10, 2021 at 4:01 history edited Emlinux CC BY-SA 4.0
added 28 characters in body
Nov 10, 2021 at 3:42 history asked Emlinux CC BY-SA 4.0

AltStyle によって変換されたページ (->オリジナル) /