
kamaroman68
USA
Asked
— Edited
Very simple logic, just don't know the commands in ez builder... Just added a maxbotics analog distance sensor. It works in ezbuilder. 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
Im not sure how to add an if command say something out ezb speaker.
IF(ADC7,lower,50)
SayEZB " I have detected something in my path "
EndIf
It comes up with an error on line 1. Says missing quotes or invalid expression.
Thanks Chris
Code:
Code:
Code:
Code:
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...
(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.
Happy building,
Asher
Code:
This simpler version should work too...
Code:
So;
Code:
You can click the stop button or run a ControlCommand to stop a script so there's no need for an escape variable.
Or, if you wanted the value displayed;
Code:
In the above example you could replace the repeat with a simple :label and Goto()
Code:
When using 2 boards you will need to tell the script commands which board to use (where applicable). This is denoted by the board number before the port i.e. Servo(0.D0, 60) or Servo(1.D0, 60)
The scripts provided so far should be a good base. but change the commands within the IF or after the ADC_Wait.
You want to use WaitForSpeech()
and an IF to determine what to do. Check both out in the script manual.