Block Guide

Here we provide short descriptions of some of the more useful CoDrone Lite blocks included in the Snap! for Robolink library.  This page will be updated as the Robolink library develops.

Screen Shot 2016-05-21 at 4.18.32 PM
Contents:
  1. [ps2id url=’#Starting’]Starting Blocks[/ps2id]
  2. [ps2id url=’#Control’]Control[/ps2id]
  3. [ps2id url=’#Connect’]Connect[/ps2id]
  4. [ps2id url=’#CoDrone’]CoDrone[/ps2id]
  5. [ps2id url=’#Variables’]Variables[/ps2id]
  6. [ps2id url=’#Operators’]Operators[/ps2id]



[ps2id id=’Starting’/]

Starting Blocks

rb_whenclicked

  • Runs all blocks attached to it when the green flag is clicked

rb_whenkeypressed

  • Runs all blocks attached to it when the specified key is pressed
  • Can be assigned to any key on the keyboard

rb_whenimclicked

  • Runs all blocks attached to it when the block is clicked

 


[ps2id id=’Control’/]

Control Blocks

rb_waitsecs

  • Waits the specified amount of time before moving on to the next block
  • All previously started commands will continue to perform

rb_forever

  • Repeats whatever blocks are inside the forever block forever

rb_repeatcount

  • Repeats whatever blocks are inside the repeat block for the specified amount of times

rb_stopall

  • Stops all currently running actions
  • The CoDrone will continue to perform the last command it was given

rb_stopallbut

  • Stops all currently running actions except for the blocks attached to this block
  • The CoDrone will continue to perform the last command it was given


[ps2id id=’Connect’/]
Connect

rb_connectonearest

  • Connects to a nearby CoDrone when clicked

rb_connecttoconnected

  • Connects to the previously connected CoDrone when clicked

rb_disconnect

  • Disconnects from the connected CoDrone when clicked

rb_forcedlanding

  • Immediately forces the CoDrone to land when clicked


[ps2id id=’CoDrone’/]
CoDrone

rb_roll

  • Sets the Roll to the indicated value

rb_pitch

  • Sets the Pitch to the indicated value

rb_yaw

  • Sets the Yaw to the indicated value

rb_throttle

  • Sets the Throttle to the indicated value

rb_sending

  • Sends the Roll, Pitch, Yaw, and Throttle values to the CoDrone to be performed

rb_flightevent

  • Performs the indicated Flight Event maneuver


[ps2id id=’Variables’/]
Variables

make-a-variable

  • Create a new variable

set-_-to

  • Set the selected variable to the indicated value

change-by

  • Add the indicated value to the selected variable


[ps2id id=’Operators’/]
Operators

math-operators

  • Perform the indicated mathematical operation

math-comparitors

  • Compares the two indicated values

and

  • Adds an additional conditional statement with an ‘and’ operator

or

  • Adds an additional conditional statement with an ‘or’ operator

not

  • Changes the conditional statement to the opposite value

true-false

  • Represents true or false