
kamaroman68
USA
Asked
— Edited
Very simple logic, just don't know the commands in ARC... Just added a maxbotics analog distance sensor. It works in ARC. What I would like is when the distance is equal to or less than 50 speak out the ezb. I set up an analog port and I'm trying to use the adc wait command, from there? Thanks Chris
Is there a way to make it loop? To make it work I have to sit and push start script. I would like to have it sense an object and say it automatically, not just once. If I walk in front of the robot I want to say it, then when I get out of its path , and return to its path say it again. I will build upon this with eventually stopping the robot.
Does it give an error?.... the code works for me
it works only when I push the start script button for me. The script runs only once.
Check my syntax as I am doing this from memory.. you need to check what values the sensor is feeding back before you can use it in a script...
I changed the code above to repeat forever so you can use it to see what values the sensor is continuing to put out...
Once you figure out what the sensor is reading and value you need you can then modify the code to actually use in your project...
Hey Richard the above code does run forever like you said. But when I add an If statement ($x) < 50) I get an error, Something about nesting. Ive had enough for tonight. Thanks for your help
Hey Kamaroman68 sorry to disturb but the reason why your getting an error message about nesting is because ($x)<50) is because you only have one pair of parentheses and a leftover one. When they say "nesting" they're saying your parentheses do not match up. I 'll give an example: (5+(3+2) if this was in a code I would get a nesting error because my parenthesis don't match up. I suggest reviewing Richard's previous example.
This code should work... again, check my syntax before running....
This simpler version should work too...