Asked — Edited
Resolved Resolved by DJ Sures!

Why Does This Script Not Work?

Below is a script I wrote to have my robot smoothly look around the room (relatively that is)... I want each servo move to execute one right after the previous one finishes... However, when I run the script it blazes through the script in about a 10th of a second.. The servos don't move(except for a quick jitter)... Do I need to use sleep() instead of Servo_wait? Am I not using the servo_wait command properly? I am also having trouble getting my servos to move to their proper positions... They only do about 75% of the time... Sometimes they don't move at all or move too far or too little... I am using 2 Hitec HS-645mg servos and my EZB3 board is using a 7.2 amp nimh battery (so no brown outs battery wise anyway)

servo(D0,50) #centre servos servo(D1,50) sleep(2000) ServoSpeed(d0,2) ServoSpeed(D1,2) Servo(D1,70) # look down Servo_Wait(D1,equals,70) Servo(D0,88) #look down right Servo_Wait(D0,equals,88) Servo(D1,35) #look up right Servo_Wait(D1,equals,35) Servo(D0,12) #look up left Servo_Wait(D0,equals,12) Servo(D1,70) #look down left Servo_Wait(D1,equals,70) Servo(D0,50) #look down centre Servo_Wait(D0,equals,50) Servo(D1,52) #look straight


ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#9  

DJ beat me to it... If you assume Arduino represents "proper coding"... Who determines what is and what is not proper coding anyway? EZ Robot's software on the surface may seem more simplistic than Arduino... However, EZb and ARC can do circles around arduino in it's capabilities... Simply put, I can do things with ARC I could never dream of with Arduino... The one drawback is that we still need smart guys like DJ to make stuff simple enough for the average Joe like me to use... No matter how much I appreciate what DJ has created here, I would still like to learn more and be less of just a complacent user....

South Africa
#10  

I saw a robot that could only avoid obsticles but it had 4 pages of coding and I did not understand any of it but in the way you guys answer my question I now know that ez robot will not require 4 pages of coding for just a simple obsticles avoider