Myo Gesture Armband icon Myo Gesture Armband Map Myo armband gestures and accelerometer to servos and ARC scripts for arm-mimic control; supports multiple armbands. Try it →
Asked — Edited
Sharp IR on car robot, table top robot avoids falling off

Sharp IR On Car Robot, Table Top Robot Avoids Falling Off

anyone know how to write this code in java?

:loop adc_wait(adc0,lower,160) stop() reverse(200,500) sleep(50) left(255,500) stop() forward() sleep(50) goto(loop)

now it starts, avoids falling off table, turns left, keeps going - cheers! All figured out below, I solved it below with help of thetechguru

thanks



Related Hardware (view all EZB hardware)
EZ-B V4 by EZ-Robot
EZ-B v4/2 robot controller: dual Cortex ARM, Wi-Fi, audio/video, 24 servo/digital ports, I2C/UART, camera and Synthiam ARC control for custom robots
Wi-Fi / USB
Servos 24
Camera
Audio
UART 3
I2C
ADC 8
Digital 24

Related Robot Skill (view all robot skills)
Infrared indoor positioning for ARC robots: dual-camera tracks IR beacon, shows real-time heading, path and EZ-Script navigation variables

ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

Author Avatar
Portugal
#33  

Yep, that seems to be the Sharp GP2Y0A21YK0F sensor. It works from 10 to 80cm.

Author Avatar
PRO
USA
#34   — Edited

Sharp GP2Y0A21YK0F GP2Y0A21 10~80cm Infrared Proximity Distance Sensor

is enough for a table top car  :-)

You always can get the Infrared Proximity Sensor Long Range - Sharp GP2Y0A02YK0F  19.95

the Description: Infrared proximity sensor made by Sharp. Part # GP2Y0A02YK0F has an analog output that varies from 2.8V at 15cm to 0.4V at 150cm with a supply voltage between 4.5 and 5.5VDC. The sensor has a Japanese Solderless Terminal (JST) Connector. We recommend purchasing the related pigtail below or soldering wires directly to the back of the module.

#35  

I have used those Sharp sensors too, and they do a pretty good job.

#36  

I've used the same Sharp sensors for years and have have had good results with them for edge and line detection.

Author Avatar
PRO
USA
#37  

Hi JustinRatliff, nice to see you again,

what script do you use ior edge detection?

I have one but it may not be as good as you ,  thanks

Author Avatar
PRO
USA
#38   — Edited

On my big robot I use 5 of this:

Sharp GP2Y0A51SK0F Analog Distance Sensor 2-15cm https://www.pololu.com/product/2450

Similar to the GP2Y0A21YK0F but a shorter range 2-15cm.

Cliff detection:

User-inserted image

#39  

@PTP   I like how small those are.  The GP2Y0A21YK0F work fine if the drop-off you are worried about is high enough.  The step I am avoiding is well over 10cm, so I just watch for an increase from unmeasurably small to measurable, but for future builds I think I'll get the Pololu ones.

Author Avatar
PRO
USA
#40   — Edited

This is why I use the Sharp GP2Y0A21YK0F GP2Y0A21 10~80cm Infrared Proximity Distance Sensor

not the Sharp Infrared Distance Sensor

PtP what script do you use for the sensors?