Hey every one. I am trying to write my first script to work on a rolling chassis. I have three pings across the front and a sharp ir sensor under it at the front to keep from going over the edge.
I have three Distance detects open one for each ping ( which are parallax) and a sharp ir collision detect open for the ir sensor.
Here is my script and it will not stop the bot when I sensor is reading less than 40 or greater than 40 on the ir sensor.
# This the main forward script
# this will get the ping data and
# and put it into a variable
$MAIN_PING = GetPing(d0,d0)
$LEFT_PING = GetPing(d1,d1)
$RIGHT_PING = GetPing(d2,d2)
#Using the Sharp sensor for edge detection and
#put the data into a variable
$FRONT_EDGE = GetADC(adc3)
If($MAIN_PING = 40)
If($MAIN_PING => 41), If($LEFT_PING => 41), If($RIGHT_PING => 41)
I dont get any syntax errors when i debug slow it runs to the first "if" line and that is it the bot just goes forward.
Any ideas on what I am messing up here.