Junior Block Documentation
version 2.0.5 (Changelog)
Flight Commands
take off
Block
Description
This functions makes the drone take off. CoDrone Mini takes off at around 3-4 ft off the ground.
Parameters
None
Returns
None
Example
land
Block
Description
This function makes the drone land by throttling down safely.
Parameters
None
Returns
None
Example
emergency stop
Block
Description
Stops all commands to motors. The drone will stop flying immediately.
Parameters
None
Returns
None
Example
go [direction] for [duration] seconds
Block
Description
Moves the drone in a direction for a given duration.
Parameters
direction: forward, backward, up, down, left, right
integer duration: the duration of movement in seconds
Returns
None
Example
go [direction] for [duration] seconds at [power] % power
Block
Description
Moves the drone in a direction for a given duration and power percentage.
Parameters
direction: forward, backward, up, down, left, right
integer power: the power/speed of the drone between 0 and 100
integer duration: the duration of the move in seconds
Returns
None
Example
turn [direction] for [duration] seconds at [power] power
Block
Description
Turns the CoDrone Mini in a given direction for the given duration at the given power percentage.
Parameters
direction: the direction of the movement (left, right)
integer power: the power/speed of the drone between 0 and 100
integer duration: the duration of the turn in seconds
Returns
None
Example
hover for [duration] seconds
Block
Description
This function makes the drone hover for a given amount of time.
Parameters
integer duration: the duration of the hover in seconds
Returns
None
Example
Flight Sequences
flip left
Block
Description
Makes the drone flip to the left.
Parameters
None
Returns
None
Example
flip right
Block
Description
Makes the drone flip to the right.
Parameters
None
Returns
None
Example
flip backward
Block
Description
Makes the drone flip backward.
Parameters
None
Returns
None
Example
flip forward
Block
Description
Makes the drone flip forward.
Parameters
None
Returns
None
Example
Status Checkers
code is running
Block
Description
Returns a True value while your code is running. Use this block instead of "while True" when you want to run a "forever" loop. Use the "Stop" button in Blockly to stop the program.
Parameters
None
Returns
boolean running: returns True if program is running, False if user presses "Stop"
Example
Lights
set drone LED color to [color], with a brightness of [brightness]
Block
Description
Sets the color of CoDrone Mini's LED.
Parameters
color: select a color from the color palette
integer brightness: brightness of the LED between 0 and 255
Returns
None
Example
set drone LED color to [color], and pattern to [pattern] with a speed of [speed]
Block
Description
Sets the color of CoDrone Mini's LED blinking pattern. "Blink" flashes the LED on and off and an interval determined by the speed parameter. "Double blink" flashes the LED twice before pausing at the interval determined by the speed parameter.
Parameters
color: select a color from the color palette
pattern: blink or double blink
integer speed: the speed of the lighting pattern from 1 to 10
Returns
None
Example
turn LED off
Block
Description
Turns off CoDrone Mini's LED.
Parameters
None
Returns
None
Example
reset LED
Block
Description
Reset's the Codrone Mini's LED back to the default red LED.
Parameters
None
Returns
None
Example
Sound
play this note [note] for [duration] seconds
Block
Description
Plays a note for a specified amount of time using the buzzer on the CoDrone Mini controller.
Parameters
note: a note from C3 to B7
integer duration: the duration of the note played, in seconds
Returns
None