12Blocks
Welcome | Contents | Getting Started | Reference | Hardware | FAQ | Buy
Blog | Forum
Overview | Editor Interface | Editor Dialogs | Advanced | Language | Blocks

Index | Arduino | BasicStamp | DemoBoard | GadgetGangster | Mindstorm | PICAXE | PropBOE | PropCade | QuickStart | Raspberry Pi | Scribbler | SpinStudio | Stingray | TBot | TBot-Prototype

Block Reference:TBot-Prototype

CONTROL | GRAPHICS | SOUND | MOTION | SENSE | VARS | INTERFACE | FUNCTIONS | PINS

TabSectionNameDetail
controlbasic startstart running a stack of blocks
repeatrun the inner blocks forever
repeat <number> timesrun 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> elseruns 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 repeatbreak out of repeat loop and continue with the following block
continue to start of repeatcontinue to start of repeat loop
stopstop 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 waitrun 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 set LED to <color>set color
1 parameter:
COLOR:
set LED with HSL=<hue> <saturation> <luminosity>set the color led
3 parameters:
HUE:
SATURATION:
LUMINOSITY:
sound play synthesized song <sound>play a synthesizer file
1 parameter:
SOUND: name of hmus file to play
stop playing song/effectstop 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> msrecord 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 microphonesense the sound level with the microphone
read microphone amplitudesense the overall amplitude with the microphone
read microphone frequencysense the dominant frequency of sound with the microphone
play tone <frequency> for <duration> msplay 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:
motionmove 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
sensetime reset timerreset the internal timer
elapsed timesense how much time has passed since the last reset
tbot set power <ir> <speaker> <usb>set power $ $ $
3 parameters:
IR:
SPEAKER:
USB:
<which button> button <button state>returns button status
2 parameters:
WHICH BUTTON: button to monitor
BUTTON STATE: button state
<which button> button <button state> within <timeout> msecwait until a button event or timeout occured
3 parameters:
WHICH BUTTON: button to monitor
BUTTON STATE: button state
TIMEOUT:
read line sensor(<button>,<sensordata>)read line sensor($,$)
2 parameters:
BUTTON: line sensor to read
SENSORDATA:
read proximity(<button>,<sensordata>)read proximity($,$)
2 parameters:
BUTTON: proximity sensor to read
SENSORDATA:
read position(<button>,<sensordata>)read position($,$)
2 parameters:
BUTTON: encoder sensor to read
SENSORDATA:
dip settingdip setting
calibrate line sensors <time>calibrate sensors
1 parameter:
TIME:
set <group> mode to <mode>set ir mode
2 parameters:
GROUP: sensor group
MODE: mode
find linefind line
varsvariables 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
interfacedebug program infodisplay info about variables, arrays and imports. Ctrl-click on imported files to open them
valuesdisplay a table listing variables and their values
graphdisplay a graph of variable values over time
logicdisplay a graph of logic levels over time
pinsdisplay a representation of the chip with live IO pin logic levels
videodisplay 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 lineclear to endof line
send clear screenclear the terminal screen
send backspacesend a backspace to the terminal
send next linesend 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 numberreceive a number from the terminal
receive bytereceive a byte from the terminal
received datatest if the terminal has sent something
terminaldisplay a terminal for text input and output
controls backgrounddisplay an image on which other interface blocks can be docked
textboxdisplay and change a variable's value with a textbox
meterdisplay a variable's value in a meter
switchdisplay and change a variable's value as a switch
joystickuse a joystick to control two variables
savesave 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
skypeattach to the skype application to allow variable values to be changed and monitored remotely
xmlrpcstart a server that supports xmlrpc communication to change and monitor variable values
rosstart 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
pinsin 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> highset a pin high
1 parameter:
PIN: pin to set high
set pin <pin> lowset 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 pinsquickly sample the IO pins