Asked
Resolved by EzAng!
is there a possebility to use the ADC inputs for controlling a servo? i try the micro servo a,d a HDD from ez robot. that didn work.
Related Hardware EZ-B IoTiny
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.
hi dj
i wanna use two ez wheel servo's. looks like the script is for one servo?
oops i can duplicate for more servo's.got it
thank you
got error
Start
That’s JavaScript I posted. I’ll never ever post ezscript
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);
}
lol how did you get that from my example hehe. Here you go...
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
i forgot to tel i wanted to use continious servo's from ez robot on port v0 and v1
Hi Nomad, how are you and how is your new robot?
EzAng
hi ezang
waiting for parts.do you have any idea how adc ports work with continious rotation?
DJ example did not help?
here is another like from site:
https://synthiam.com/Community/Tutorials/Using-ADC-Analog-to-Digital-Ports-Commands-and-Controls-16283
oh does the adc only have 3 volts?
did you read the link I put on?
https://synthiam.com/Community/Tutorials/Using-ADC-Analog-to-Digital-Ports-Commands-and-Controls-16283
Steve said: Step 1. About the ADC ports. There are 8 ADC Ports on the EZ-B v4 numbered "A0" to "A7" that you can connect devices like analog sensors. Each ADC port contains three pins...
Ground: (output) located towards the centre of the board.
VDC: (output) The centre pin, regulated at 3.3 volts.
Signal: (input) The outermost pin from the centre of the board which reads the voltage between 0 and 3.3 volts.
The ADC ports are Configurable at 8-bit (0-255) or 12-bit (0-4095) in software.
In an ADC control found in the ARC software, such as "Read ADC", ADC reading intervals can be selected from 100 ms to 60000 millisecond analog values.
Analog readings are from 1 to 255 (0v to 3.3v) in 8 bit mode, or 0 to 4,095 in 12 bit mode.
read on
I have to leave now - maybe Ptp or DJ can help, sorry
ezang
yes i have the link
thanks
Ezang
you cant controle a servo with adc ports.
thanks
https://synthiam.com/Community/Tutorials/Using-ADC-Analog-to-Digital-Ports-Commands-and-Controls-16283/5
Using ADC (Analog to Digital) Ports, Commands and Controls. Step 5. Step 4. Controlling servos with sensors and ADC ports.
i saw it but you cant controle a servo on a adc port itself. i wonder would a LED work? on a adc port?
Sorry for all the links, I personally never used ADC yet, Read this link:
https://synthiam.com/Community/Questions/Adc-Value-To-Servo-Movement-9783
Seems like you need a script:
Rich:
ADC to servo movement
:loop $value=GetADC(ADC0) $position = $value/100 $position = Round($position,0) Servo(D1,$position) Sleep(250) Goto(loop)
Or
/ ADC to servo movement
:loop $value=GetADC(ADC0) $position = $value/100 $position = Round($position,0) $position = Map($value, 54, 129, 180, 1 ) #adjusted first two values to read min/max read ADC project, 2nd two for direction (reverse 1 and 180). Servo(D0,$position) Sleep(250) Goto(loop)
i wanted to use contineous rotation servo's.
from NallyCat - @Nomad 6R there is a tutorial on synthiam for that, have a look at " Using ADC (Analog to Digital) Ports, Commands and Controls." by Steve G.
Looks like the one I already gave you - check
EzAng
i have another question about adc ports.didn want to open another topic. is it possible to control a LED ,excample on/off ,with an adc port? i notest a led goes on from 3 volt.