ARC Pro

Upgrade to ARC Pro

Unleash your robot's full potential with the cutting-edge features and intuitive programming offered by Synthiam ARC Pro.

PRO
Synthiam
#1  

This would work... Maps the adc's input between 0 and 255 to servo degrees 1 to 180. It'll work on d0 and ADC0.


while (true) {

  // duplicate this line for other servos
  Servo.setPosition(d0, Utility.map(ADC.get(ADC0), 0, 255, 1, 180));

  sleep(100);
}

PRO
Belgium
#2  

hi dj

i wanna use two ez wheel servo's. looks like the script is for one servo?

PRO
Belgium
#3  

oops i can duplicate for more servo's.got it

thank you

PRO
Belgium
#4  

got error

Start

Error on line 1: Missing String Quotes or Invalid Expression at index 0: while ( ( Done (00:00:00.0094850)

PRO
Synthiam
#5  

That’s JavaScript I posted. I’ll never ever post ezscript

PRO
Belgium
#6  

this what i have .

while(0)(true)
while(1)(true)

{ // duplicate this line for other servos

Servo.setPosition(d0, Utility.map(ADC.get(ADC0), 0, 255, 1, 180));

Servo.setPosition(d1, Utility.map(ADC.get(ADC1), 0, 255, 1, 180));

sleep(100);

}

PRO
Synthiam
#7  

lol how did you get that from my example hehe. Here you go...

while(true) {

Servo.setPosition(d0, Utility.map(ADC.get(ADC0), 0, 255, 1, 180));


Servo.setPosition(d1, Utility.map(ADC.get(ADC1), 0, 255, 1, 180));


sleep(100);

}
PRO
Belgium
#8  

haha i was not far off.but it doesn move the ADC0 servo. it move head d0 and d1. i wanted to use ADC0 and ADC1 alone