Tab | Section | Name | Detail |
control | basic | start | start running a stack of blocks |
repeat | run the inner blocks forever | ||
repeat <number> times | run the inner blocks a number of times 1 parameter: NUMBER: number of times to loop | ||
repeat <index variable> from <start> to <end> step <step> | run the inner blocks with an index variable 4 parameters: INDEX VARIABLE: variable name whose value ranges from the start to the end values START: the value with which the loop will start END: the value with which the loop will end STEP: the amount by which the index variable will change after each cycle | ||
repeat with <variable list> as <values> | run the inner blocks with variables whose values changes over time 2 parameters: VARIABLE LIST: variable names whose values change over time VALUES: values the variables will take on | ||
repeat while <condition> | run the inner blocks while the condition is true 1 parameter: CONDITION: condition that needs to be true to run the inner stacks | ||
repeat until <condition> | run the inner blocks until the condition is true 1 parameter: CONDITION: condition that needs to be true to keep running the inner blocks | ||
wait <duration> | pause for a while 1 parameter: DURATION: time in milliseconds | ||
if <condition> else | runs the inner blocks if the condition is true 1 parameter: CONDITION: when this condition is true, the inner blocks will run | ||
switch <expression> | runs the inner block whose value matches the condition 1 parameter: EXPRESSION: expression to switch on *MATCH*: when this matches the expression, the inner blocks will run *Right click on block to access Properties for custom parameters | ||
<comment> | document your code with text, a schematic or an image 1 parameter: COMMENT: comment which explains your code | ||
advanced | break out of repeat | break out of repeat loop and continue with the following block | |
continue to start of repeat | continue to start of repeat loop | ||
stop | stop the program | ||
constant:<constants> | assign names to numbers that won't change during the program 1 parameter: CONSTANTS: comma separated list of names and their values | ||
<code> | inline programming code written in the device's language 1 parameter: CODE: textual representation of code to inline into the program | ||
state | when in state <state name> | run a set of blocks when the state machine matches this state 1 parameter: STATE NAME: name of the state assigned to this stack of blocks | |
run state machine <name of state machine> | run a state machine that manage program behavior using a state variable 1 parameter: NAME OF STATE MACHINE: variable to use for storing machine's state | ||
set state to <state name> | set the state of the state machine 1 parameter: STATE NAME: the state machine's new state | ||
event | when <condition> | run a set of blocks when a condition is true 1 parameter: CONDITION: condition which starts this stack of blocks | |
task <task name> | group a set of blocks into a named task 1 parameter: TASK NAME: name of task associated with this stack of blocks | ||
start task <task name> | start a named task and continue right away 1 parameter: TASK NAME: task to run | ||
at <time> do <task name> | at a set time, run a named task 2 parameters: TIME: time in msec TASK NAME: task to run | ||
start task <task name> and wait | run a named task and wait for it to finish before continuing 1 parameter: TASK NAME: task to run | ||
synchronize tasks <synchronize> | create a set of blocks that will run tasks at exact times 1 parameter: SYNCHRONIZE: | ||
graphics | text | print text <string> | print text to a monitor 1 parameter: STRING: text to display to screen |
print value <value> | print value to a monitor 1 parameter: VALUE: value to display to screen | ||
clear screen | clear the monitor | ||
backspace | move back one space | ||
next line | go to the next line | ||
set text color to <color> | set the drawing color 1 parameter: COLOR: color to set | ||
goto (<x>,<y>) | set cursor to a new position 2 parameters: X: x position of cursor Y: y position of cursor | ||
graphics | print text <string> to (<x>,<y>) | print text to a location on the screen 3 parameters: STRING: text to print X: x position of cursor Y: y position of cursor | |
clear screen | clear the screen | ||
update screen | update the screen | ||
set pen color to <color> | set the drawing color 1 parameter: COLOR: color used for drawing graphics | ||
set width to <width> | set the drawing width 1 parameter: WIDTH: width used for drawing graphics | ||
plot(<x>,<y>) | draw a point 2 parameters: X: x position of point being drawn Y: y position of point being drawn | ||
draw line to (<x>,<y>) | draw a line 2 parameters: X: x position of line endpoint Y: y position of line endpoint | ||
draw sprite <sprite> to (<x>,<y>) rotated <angle> | draw a figure 4 parameters: SPRITE: filename of sprite to draw X: x position of sprite Y: y position of sprite ANGLE: angle to rotate the sprite | ||
draw vector <vector> to (<x>,<y>) rotated <angle>, scaled <scale> | draw a vector 5 parameters: VECTOR: X: x position of sprite Y: y position of sprite ANGLE: angle to rotate vector drawing SCALE: size of drawing | ||
draw box: start(<x>,<y>) size: (<width>,<height>) | draw a box 4 parameters: X: x position of box Y: y position of box WIDTH: width of box HEIGHT: height of box | ||
fill triangle: (<x1>,<y1>)-(<x2>,<y2>)-(<x3>,<y3>) | draw a triangle 6 parameters: X1: x position of triangle vertex 1 Y1: y position of triangle vertex 1 X2: x position of triangle vertex 2 Y2: y position of triangle vertex 2 X3: x position of triangle vertex 3 Y3: y position of triangle vertex 3 | ||
stream | plot(<x>,<y>) with <color> | draw a point to built viewer 3 parameters: X: x position of point being drawn Y: y position of point being drawn COLOR: color | |
draw box: color (<color>) start(<x>,<y>) size: (<width>,<height>) | draw a box to builtin viewer 5 parameters: COLOR: box color X: x position of box Y: y position of box WIDTH: width of box HEIGHT: height of box | ||
clear screen | clear the built in viewer | ||
update screen | update the built in viewer | ||
lcd | print text <string> | write text to an lcd 1 parameter: STRING: text to display to screen | |
print value <value> | write a value to an lcd 1 parameter: VALUE: value to display to screen | ||
clear screen | clears the lcd | ||
goto (<x>,<y>) | set the lcd's cursor position 2 parameters: X: x position of cursor Y: y position of cursor | ||
scroll <direction> | scroll the lcd 1 parameter: DIRECTION: scrolling direction | ||
set contrast to <contrast> | set the lcd's contrast level 1 parameter: CONTRAST: contrast level | ||
fade to <contrast> | fade the lcd 1 parameter: CONTRAST: contrast level | ||
sound | play synthesized song <sound> | play a synthesizer file 1 parameter: SOUND: name of hmus file to play | |
stop playing song/effect | stop playing sounds on the synthesizer | ||
play sound effect <sound> | play a sound effect file 1 parameter: SOUND: name of hsfx file to play | ||
play score <score> | play a score of music notes as tones 1 parameter: SCORE: score to play | ||
pluck score <score> | play a score of music notes as plucked notes 1 parameter: SCORE: score to play | ||
set pluck volume to <volume> tempo to <tempo> sustain to <sustain> | set the parameters of how plucked music sounds 3 parameters: VOLUME: volume to pluck at TEMPO: tempo of plucking SUSTAIN: sustain of pluck | ||
play wav file <sound> at volume <volume> | play a wav file 2 parameters: SOUND: name of wav file to play VOLUME: volume to play file at | ||
record sound for <duration> ms | record a sound to memory 1 parameter: DURATION: milliseconds to record sound | ||
play recorded sound at volume <volume> | play back recorded sound from memory 1 parameter: VOLUME: volume to play sound at | ||
read microphone | sense the sound level with the microphone | ||
read microphone amplitude | sense the overall amplitude with the microphone | ||
read microphone frequency | sense the dominant frequency of sound with the microphone | ||
play tone <frequency> for <duration> ms | play a tone of music 2 parameters: FREQUENCY: frequency of tone DURATION: milliseconds to play tone | ||
set tone volume to <volume> | set how loud tones will be played 1 parameter: VOLUME: volume to play tone at | ||
speak <speech> | speak text using a speech synthesizer 1 parameter: SPEECH: text to say | ||
speak file <speech> | speak sounds specified in a file 1 parameter: SPEECH: text to say | ||
spell <speech> | spell text with a speech synthesizer 1 parameter: SPEECH: text to say | ||
set speech volume to <volume> | set how loud speech will be spoken 1 parameter: VOLUME: volume to use for speech | ||
speech parameters <glottal pitch>,<vibrato pitch>,<vibrato rate>,<pace> | set the parameters of the speech synthesizer 4 parameters: GLOTTAL PITCH: voice pitch, 100=110hz VIBRATO PITCH: voice vibrato pitch, 48=+/- half octave swing VIBRATO RATE: voice vibrato rate, 52=4Hz PACE: rate at which word is spoken | ||
set speaker <speaker> to pitch <base> | Assign a base pitch to speaker number 2 parameters: SPEAKER: BASE: | ||
motion | move | move <amount> mm <turn-ratio> | move a distance with a turning ratio 2 parameters: AMOUNT: amount to drive robot in mm, negative to reverse TURN-RATIO: ratio of left and right motor speeds that affects how the robot will turn while moving |
turn <degrees> deg <direction> | turn an amount in a direction 2 parameters: DEGREES: degree to turn robot, negative to reverse DIRECTION: which way to turn the robot, negative to turn left | ||
set left motor speed to <left> and right to <right> | set the speed of the drive motors; the motors will maintain this speed until the next move block is run 2 parameters: LEFT: speed for the left motor RIGHT: speed for the right motor | ||
set finish move mode to <action> | set what should happen when move and turn blocks finish running 1 parameter: ACTION: | ||
set cruise speed <speed at which robot will turn/move> | set the speed of the move and turn blocks 1 parameter: SPEED AT WHICH ROBOT WILL TURN/MOVE: | ||
configure move with <move>,<turn> | set scale factor for robot move/turn blocks 2 parameters: MOVE: amount robot will move, higher numbers move further TURN: amount robot will turn, higher numbers turn further | ||
configure motor with <zerol>,<zeror>,<gainl>,<gainr>,<gainl>,<gainr> | set motor offset and scale parameters 6 parameters: ZEROL: zero offset for left motor ZEROR: zero offset for left motor GAINL: +gain for left motor GAINR: +gain for right motor GAINL: -gain for left motor GAINR: -gain for right motor | ||
servos | set servo <pin> to <position> | set a servo's position 2 parameters: PIN: pin number of servo POSITION: target position for servo | |
ramp servo <pin> to <position>% over <time> | ramp a servo's position over time while running other blocks 3 parameters: PIN: pin number of servo POSITION: target position for servo, from -30 to 130 TIME: milliseconds to ramp the servo to the new position | ||
idle servo <pin> | idle a servo- don't power it 1 parameter: PIN: pin number of servo | ||
sense | IR distance on <pin> | sense distance with an IR/LED 1 parameter: PIN: pin number of the IR/LED | |
ultrasound distance on <port> | sense distance with ultrasound sensor 1 parameter: PORT: port of the sensor | ||
brightness on <pin> | sense light level with QTI sensor 1 parameter: PIN: pin number of the QTI sensor | ||
button down on <button> | button down on $ 1 parameter: BUTTON: button to query | ||
mouse | mouseX | read the x position of the mouse | |
mouseY | read the y position of the mouse | ||
mouseZ | read the z position of the mouse | ||
set mouse to (0,0,0) | reset x,y and z | ||
mouse button down | determine if the mouse button was clicked | ||
key | key <key> pressed | determine if a keyboard key is pressed 1 parameter: KEY: key to test | |
8031 | read adc on pin <data out pin> | sense the adc's value 1 parameter: DATA OUT PIN: data out pin followed sequentially by the clock pin and the chip select pin. | |
read 10 bit adc on pin <adc> | sense the adc's 10 bit value 1 parameter: ADC: adc pin | ||
time | reset timer | reset the internal timer | |
elapsed time | sense how much time has passed since the last reset | ||
vars | variables | set <variable> to <value> | set a variable to a value 2 parameters: VARIABLE: variable to set VALUE: new value for variable |
change <variable> by <amount> | change a variable's value 2 parameters: VARIABLE: variable to change AMOUNT: amount added to variable | ||
set bit <bit> of <variable> to <new bit value> | set a bit 3 parameters: BIT: bit to set VARIABLE: variable to modify NEW BIT VALUE: bit value | ||
get bit <bit> of <variable> | get a bit 2 parameters: BIT: bit to get VARIABLE: variable to inspect | ||
random(<max>) | return a random number between 0 and the specified maximum 1 parameter: MAX: | ||
set <variable> to address of <value> | get pointer to a variable 2 parameters: VARIABLE: pointer VALUE: pointee | ||
arrays | set <array>(<index>) to <value> | set an array's item to a value 3 parameters: ARRAY: array to set INDEX: index of array item to set VALUE: new value for array item | |
change <array>(<index>) by <amount> | change an array's item 3 parameters: ARRAY: array to change INDEX: index of array item to change AMOUNT: amount added to array item | ||
get <array>(<index>) | get an array's item 2 parameters: ARRAY: array to retrieve INDEX: index of array item to retrieve | ||
strings | set <string> to <string> | copy text into the string variable 2 parameters: STRING: string to modify STRING: text to assign | |
set <string> to value <new value> | copy the value as text into the string variable 2 parameters: STRING: string NEW VALUE: value to add | ||
string <first> equals <second> | determine if the two strings are equal 2 parameters: FIRST: first text/string to compare SECOND: second text/string to compare | ||
lowercase <text> | return the lowercase of the string 1 parameter: TEXT: string to modify | ||
uppercase <text> | return the uppercase of the string 1 parameter: TEXT: string to modify | ||
capitalize <text> | capitalize the string 1 parameter: TEXT: string to modify | ||
reverse <text> | reverse the letters of the string 1 parameter: TEXT: string to modify | ||
make <count> copies of <text> | return a number of copies of the string 2 parameters: COUNT: number of copies to make TEXT: string to modify | ||
trim <text> | trim the string 1 parameter: TEXT: string to modify | ||
pad <text> to length <length> with <pad> | pad string with a string 3 parameters: TEXT: string to modify LENGTH: length to pad to PAD: text/string to pad with | ||
replace <replacee> with <replacer> in <text> | replace text in a string with another text 3 parameters: REPLACEE: old text REPLACER: new text TEXT: string to modify | ||
join <new text> to <text> | join one string onto another 2 parameters: NEW TEXT: text/string to add TEXT: string join to | ||
put <item> split of <text to split> into <result> | split text from a string and put a specified item into another string 3 parameters: ITEM: item of split TEXT TO SPLIT: text/string to split RESULT: result string | ||
join <new byte> to <text> | join a byte to a string 2 parameters: NEW BYTE: byte to add TEXT: string join to | ||
get character <text>(<index>) | retrieve an indexed character 2 parameters: TEXT: text/string from which to get a character INDEX: index | ||
copy substring from <text> starting at <start> for <count> to <output> | copy a substring from a string to another string 4 parameters: TEXT: text/string from which to make substring START: starting index COUNT: characters to copy OUTPUT: output string | ||
copy string beginning with <begin> in <text> starting at <start> to <output> | copy a string that begins with a specified text to another string 4 parameters: BEGIN: text/string to find TEXT: text/string to search in START: starting index OUTPUT: output string | ||
find index of string <string> in <text> starting at <start> | find where a string matches 3 parameters: STRING: string to find TEXT: text/string to search START: starting index | ||
find first index of <character> in <text> starting at <start> | find where a character matches 3 parameters: CHARACTER: character to find TEXT: text/string to search START: starting index | ||
find last index of character <character> in <text> starting at <start> | find the last occurance of a character 3 parameters: CHARACTER: character to find TEXT: text/string to search START: starting index | ||
length of <text> | calculate the length of the string 1 parameter: TEXT: text/string to count | ||
convert <text> to a number in base <base> | convert the numeric value in a string into an integer 2 parameters: TEXT: text/string to search BASE: use 10 to convert to decimal | ||
interface | debug | program info | display info about variables, arrays and imports. Ctrl-click on imported files to open them |
values | display a table listing variables and their values | ||
graph | display a graph of variable values over time | ||
logic | display a graph of logic levels over time | ||
pins | display a representation of the chip with live IO pin logic levels | ||
video | display video from device | ||
terminal | send text <text> | send text to the terminal 1 parameter: TEXT: text to send | |
send value <value> | send a value to the terminal 1 parameter: VALUE: value to send | ||
send <text> <value> | send text and colored number to the terminal then clear end of line 2 parameters: TEXT: text to send VALUE: value to send | ||
send clear to end of line | clear to endof line | ||
send clear screen | clear the terminal screen | ||
send backspace | send a backspace to the terminal | ||
send next line | send the terminal to the next line | ||
send goto <x>,<y> | set the terminal's position 2 parameters: X: x position of cursor Y: y position of cursor | ||
set color <color> | set terminal text color 1 parameter: COLOR: color of text | ||
receive text into <string> | receive text from the terminal and store in a string 1 parameter: STRING: string into which to store received text | ||
receive number | receive a number from the terminal | ||
receive byte | receive a byte from the terminal | ||
received data | test if the terminal has sent something | ||
terminal | display a terminal for text input and output | ||
controls | background | display an image on which other interface blocks can be docked | |
textbox | display and change a variable's value with a textbox | ||
meter | display a variable's value in a meter | ||
switch | display and change a variable's value as a switch | ||
joystick | use a joystick to control two variables | ||
save | save to file | ||
advanced | simulate <sim> | display a bird's eye view of a robot environment and simulate the robot's movements 1 parameter: SIM: world | |
swarm <config> | swarm $ 1 parameter: CONFIG: swarm configuration | ||
skype | attach to the skype application to allow variable values to be changed and monitored remotely | ||
xmlrpc | start a server that supports xmlrpc communication to change and monitor variable values | ||
ros | start a ros node to support monitoring and changing variables using the robot operation system | ||
fiducial <function> | communicate with a fiducial image server to recognize where objects are with vision 1 parameter: FUNCTION: | ||
functions | <name> (<arguments>) locals:<local variables> | group a set of blocks to a named function, you can specify arguments passed into the function as well as local variables 3 parameters: NAME: name for this function ARGUMENTS: arguments passed to this function LOCAL VARIABLES: names of variables that are only used in this function | |
return <return value> | return a value from a function 1 parameter: RETURN VALUE: value to return | ||
pins | in | count edges on pin <pin> for <duration> | count the number of rising edges on a pin 2 parameters: PIN: pin number to count edges on DURATION: milliseconds during which edges are counted |
measure frequency on pin <pin> for <duration> | measure the frequency on a pin 2 parameters: PIN: pin number to measure frequency on DURATION: milliseconds during which frequency is measured | ||
measure pulse on pin <pin> at state <state> | measure the duration of a pulse a pin 2 parameters: PIN: pin number to measure pulse on STATE: state of pin | ||
pin <pin> | read the state of an IO pin 1 parameter: PIN: pin on which state is measured | ||
duration of discharge on pin <pin> | measure the time until a pin's state changes 1 parameter: PIN: pin which is tested | ||
shift data in from pin <pin> mode <mode> | shift in 8 bits of data using 3 pins 2 parameters: PIN: pin on which data is shifted in, followed sequentially by the clock pin and then the chip select pin MODE: mode: 0 = MSBPRE 0 Data is msb-first; sample bits before clock pulse 1 = LSBPRE 1 Data is lsb-first; sample bits before clock pulse 2 = MSBPOST 2 Data is msb-first; sample bits after clock pulse 3 = LSBPOST 3 Data is lsb-first; sample bits after clock pulse | ||
serial in from pin <pin> mode:(<baud>,<mode>,<bits>) | read data using the serial protocol 4 parameters: PIN: pin from which data is received BAUD: rate at which data is received MODE: mode: 0=inverted(normally low) 1=non-inverted(normally high) BITS: number of bits to receive | ||
read i2c on pin <pin> and reply with <ackbit> | read byte using i2c protocol and acknowledge 2 parameters: PIN: pin to transmit on ACKBIT: acknowledge bit | ||
read <bytes> bytes from <address> into <data> | read data from an i2c eeprom 3 parameters: BYTES: bytes to write ADDRESS: eeprom address DATA: data array | ||
out | output frequency <frequency> on pin <pin> | continually output a frequency on a pin 2 parameters: FREQUENCY: frequency to output in Hz PIN: pin for output | |
output frequency <frequency> on pin <pin> for <duration> | output a frequency on a pin for a duration 3 parameters: FREQUENCY: frequency to output in Hz PIN: pin for output DURATION: milliseconds for output | ||
set pin <pin> high | set a pin high 1 parameter: PIN: pin to set high | ||
set pin <pin> low | set a pin low 1 parameter: PIN: pin to set low | ||
toggle pin <pin> | change a pin's state from high to low/low to high 1 parameter: PIN: pin to change | ||
output pulse length <duration>uSec on pin <pin> | output a pulse 2 parameters: DURATION: microseconds to output pulse PIN: pin to output | ||
output pwm <duty> on pin <pin> | output a pulse width modulated signal 2 parameters: DUTY: duty cycle, form 0 to 256 PIN: pin to output | ||
output pwm <duty> on pin <pin> for <duration> | output a pulse width modulated signal 3 parameters: DUTY: duty cycle, form 0 to 256 PIN: pin to output DURATION: milliseconds for output | ||
shift out data <data> on pin <pin> mode <mode> | shift data to a device 3 parameters: DATA: value to shift out PIN: pin to output to MODE: mode | ||
send serial data <data> on pin <pin> mode:(<baud>,<mode>,<bits>) | send data with the serial protocol 5 parameters: DATA: value to transmit PIN: pin to transmit on BAUD: rate at which data is transmitted MODE: mode: 0=inverted(normally low) 1=non-inverted(normally high) BITS: bits to transmit | ||
initialize i2c device on <pin> | initialize the i2c device 1 parameter: PIN: i2c scl pin | ||
send start i2c token on <pin> | send a start i2c token 1 parameter: PIN: i2c scl pin | ||
write i2c data <data> to pin <pin> | write data with the i2c protocol 2 parameters: DATA: value to transmit PIN: pin to transmit on | ||
send stop i2c token on <pin> | send a stop i2c token 1 parameter: PIN: i2c scl pin | ||
write <bytes> bytes of <data> to <address> | write data to an i2c eeprom 3 parameters: BYTES: bytes to write DATA: data array ADDRESS: eeprom address | ||
share array: <arrays> | share arrays with 12Blocks to upload/download data 1 parameter: ARRAYS: type a quoted, commas separated list of array names | ||
quickly sample the IO pins | quickly sample the IO pins | ||