Functions
Sleep (milliseconds) Pauses for specified milliseconds Example: Sleep(1000)
SleepRandom (lowMilliSec, highMilliSec) Pauses for a random millisecond delay between the 2 provided values Example: SleepRandom(1000, 5000)
Servo (servoPort, position) Move servo to the specified position Example: Servo(D14, 25)
ServoUp (servoPort, count) Increment the servo position value up by specified count Example: Servo(D14, 1)
ServoDown (servoPort, count) Decrement the servo position value by specified count Example: Servo(D14, 1)
ServoRandom (servoPort, lowPosition, highPosition) Move the servo to a random position between low and high Example: Servo(D14, 10, 20)
Release (servoPort) Release a servo from holding its position Example: Release(D14)
Move (servoPort, [forward/stop/reverse]) Set a modified servo to move Example: Move(D14, FORWARD)
Set (digitalPort, [on/off/true/false]) Set a digital port state to either on or off Example: Set(D2, OFF)
ToggleDigital (digitalPort ) Toggle the digital port
Digital_Wait (digitalPort, [on/off/true/false]) Wait until the digital port status has changed Example: Digital_Wait(D12, ON)
ADC_Wait (adcPort, [higher/lower/equals], value) Wait until ADC port is higher or lower than specified value Example: ADC_Wait(ADC0, HIGHER, 50)
Movement_Wait ([forward/reverse/stop/left/right]) Wait until a movement from the Movement Panel is specified. Even if another script executes a movement, this will execute Example: Movement_Wait(FORWARD)
Servo_Wait (digitalPort, [higher/lower/equals], value) Wait until the servo Port is higher or lower than specified value. Zero can be specified as a value for a stopped servo. Example: Servo_Wait(D5, HIGHER, 20)
WaitForServoMove (servoPort) Waits for the specified servo to move. Unlike Servo_Wait, this function does not wait for a specific value. It simply returns once the servo has moved to a new position. Example: WaitForServoMove(d0)
Ping_Wait (triggerPort, echoPort, [higher/lower/equals], inches) Wait until the Ping Sensor distance is higher or lower than specified value in inches. Trigger and Echo are Digital Ports Example: Ping_Wait(D3, D4, HIGHER, 50)
Forward( [fastest/fast/slow/slowest] ) Using the servo port settings from a Movement Panel Control, this will start your robot in the Forward direction. Optionally, you can provide the speed or leave the parameter empty. You will require at least one Movement Panel to be configured within the project. This function will control that movement panel.
Reverse( [fastest/fast/slow/slowest] ) Using the servo port settings from a Movement Panel Control, this will start your robot in the Reverse direction. Optionally, you can provide the speed or leave the parameter empty. You will require at least one Movement Panel to be configured within the project. This function will control that movement panel.
Stop() Using the servo port settings from a Movement Panel Control, this will stop your robot. You will require at least one Movement Panel to be configured within the project. This function will control that movement panel.
Left( [milliSeconds] ) Using the servo port settings from a Movement Panel Control, this will turn your robot left. You will require at least one Movement Panel to be configured within the project. This function will control that movement panel. Optionally, you can specify the number of milliseconds to turn. Example #1: Left() Example #2: Left(200)
Right( [milliSeconds] ) Using the servo port settings from a Movement Panel Control, this will turn your robot right. You will require at least one Movement Panel to be configured within the project. This function will control that movement panel. Optionally, you can specify the number of milliseconds to turn. Example #1: Right() Example #2: Right(200)
Sound_Random( digitalPort, noteLength, noteCount) Plays a little random melody out of the EZ-B speaker that is on the specified digitalPort. Note length is in MS, and noteCount is the number of notes to play.
Sound_Note( digitalPort, noteLength, note) Plays a note out of the speaker that is on the specified digitalPort. Note length is in MS, and note is the number of note to play.
Say( text to speech ) Speaks the text that is specified within the brackets out of the PC Sound Card.
SendI2C( hexAddress, data, .... ) Send a series of data to the specified hex address over the I2C interface Data can be Hex (0x09), character ('c'), string ("string"), or decimal (188) Example: SendI2C(0x09, 'n', 0x00, 0x50, 244, "This is text")
SendSerial( digitalPort, baudRate, data, ... ) Send a series of data over the specified port and baud rate Data can be Hex (0x09), character ('c'), string ("string"), or decimal (188) Example: SendI2C(0x09, 'n', 0x00, 244, "This is text")
WaitUntilTime( hour, minute ) Pauses until the specified time. To be cpu friendly, the accuracy is within the minute of the specified time. It will trigger within the minute, just not on the minute. Example: WaitUntilTime(17, 30)
MP3TriggerPlayTrack( digitalPort, baud, trackNumber ) Plays the specified MP3 track from the MP3 Trigger Sheild Example: MP3TriggerPlayTrack( d0, 38400, 1 )
MP3TriggerPlayRandomTrack( digitalPort, baud, lowestTrackNum, highestTrackNum ) Plays a random MP3 track from the MP3 Trigger Sheild between the supplied track numbers Example: MP3TriggerPlayTrack( d0, 38400, 1, 10 )
MP3TriggerNext( digitalPort, baud ) Plays the next MP3 track from the MP3 Trigger Sheild Example: MP3TriggerPlayNext( d0, 38400 )
MP3TriggerPrev( digitalPort, baud ) Plays the previous MP3 track from the MP3 Trigger Sheild Example: MP3TriggerPrevious( d0, 38400 )
MP3TriggerStop( digitalPort, baud ) Stops the current MP3 track from the MP3 Trigger Sheild Starts the mp3 file if not playing Example: MP3TriggerStop( d0, 38400 )
ControlCommand( windowName, windowControlCommand ) Sends a command to the window by its name Example: ControlCommand( "ADC Graph", pause )
Commented Text
Comment a line of code
:Label Defines a label for a GOTO() command Example: :My_Label
Goto( label ) Goto a specific :Label location Example: Goto(My_Label)
If ( servo [Port] [Condition] [Value] ) Queries a servo Port for its position against your condition. Port is a servo Port (between d0 and d20) Condition is either =, , =, Value is an user defined integer If true, the following command (next line) is executed If false, the following command (next line) is skipped Example: If (Servo D0 > 5)
If ( ADC [Port] [Condition] [Value] ) Queries an ADC Port for its value against your condition. Port is an ADC Port (between adc0 and adc7) Condition is either =, , =, Value is an user defined integer If true, the following command (next line) is executed If false, the following command (next line) is skipped Example: If (ADC ADC2 > 50)
If ( Digital [Port] [Condition] [Value] ) Queries a Digital Port for its state against your condition. Port is a Digital Port (between d0 and d20) Condition is either =, Value is either True or False If true, the following command (next line) is executed If false, the following command (next line) is skipped Example: If (Digital D0 false)
References
Multiple EZ-B Boards EZ-Builder supports multiple physical EZ-B Boards connected to your computer. You can specify the board by putting the board number in front of the command. For example: 2.Servo(d0, 8) will move the D0 servo on EZ-B board #2 to position 8. If no board is specified, the first board (zero) is assumed. If using more than one board, the first board is always responsible for movement panels.
ADC Ports ADC0 ADC1 ADC2 ADC3 ADC4 ADC5 ADC6 ADC7 ADC8
Servo/Digital/Uart Ports D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19
Baud Rates 300 1200 2400 4800 9600 19200 38400 57600
Window Control Commands All Controls PauseOn PauseOff PauseToggle
Camera Device
CameraServoTrackEnable
CameraServoTrackDisable
CameraServoTrackToggle
CameraMovementTrackEnable
CameraMovementTrackDisable
CameraMovementTrackToggle
Camera Device Tracking Modes
CameraColorTracking
CameraMotionTracking
CameraView
CameraFaceTracking
CameraAutoTracking
Camera Snapshot
CameraSnapshot
Scripting
ScriptStart
ScriptStop
Personality Generator
RunOnce
Sound Board
Track_0 ... Track_9
Music Notes C1 Db1 D1 Eb1 E1 F1 Gb1 G1 Ab1 A1 Bb1 B1 C2 Db2 D2 Eb2 E2 F2 Gb2 G2 Ab2 A2 Bb2
Can I have an example for the Forward( [fastest/fast/slow/slowest] ) and Reverse ( [fastest/fast/slow/slowest] ).
Forward(fastest) or Forward(fast) or Forward(slow) or Forward(slowest)
:D
or Forward()
Thanks
I was wondering what the command was to start a script with a joystick button.
Hi Creativita,
That command would be: ControlCommand( "Script Name", ScriptStart )
where Script Name is whatever you name your script, just don't forget the quotes.
Thanks for that skater-j10
Is it possible in ARC to make two servos turn at once by using one command.