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
Asked
— Edited
And your motion thing is up next btw
Do you want a "toggle/on/off for the repeat" option?
the motor controller is sabertooth 2x25 and it only has 2 inputs (for controlling 2 motors), it has Signal 1 and Signal 2.
i can not get my ez-b to communicate with the motor controller.
2) Connect the 2 RC pins from the controller to 2 I/O pins of the EZ-B. The I/O pins are not labeled GND or +5. It is the furthest pin out. Make sure it's Digital, not ADC. Check the manual. Digital pins start with a D
3) Add a Modified servo panel.
4) Press CONFIG
5) Select the two ports you connected the SAbertooth controller to
6) Use the directional arrows to drive your robot
If that doesn't work, your sabertooth isn't configured correctly. Contact their support for assistance on their product and why RC mode doesn't work.
I was wondering if there is any way to get the script editor to accept math functions? I'm trying to set up a proper analogue system with potentiometers in place of the Joystick option, but it seems the only way to get it to work is to hard set the values on the ADC, so if the ADC = 10 the servo = 1, if the ADC = 20 the servo = 2, and so on.
Naturally, to get a full servo sweep, this creates a huge amount of code to run every frame and takes about 0.2 seconds to complete the evaluations for a full servo sweep. And this latency leads to the evaluation missing the mark, so the servo position fails to update, unless the the evaluation frame just happens to fall on the exact analogue value of 10 or 20, etc...
What I was hoping for was a way to write an equation that automatically reads the position of the ADC and calculates the servo position accordingly, without having to hard code it. This way, if I'm creating an analogue control system (like a glove or armateur) I'm not forced to destroy a perfectly good USB controller, and I can make my ranges a lot more dynamic.
Any thoughts?
hope very soon DJ
or
Add Control -> Script -> C#
The VB is very easy to use
Regarding your Post on 5/7/2012:
Is there supposed to be specific controls for VB and C#, With in ARC?
Does the Add control -> Scripting -> EZ-Script accept VB/C#?
Not sure what you mean by the post...