Junior Block Documentation
version 1.1.27
Flight Commands
take off
Block
Description
This function makes the CoDrone take off from the ground.
Parameters
None
Returns
None
Example
land
Block
Description
This function slowly lands the CoDrone.
Parameters
None
Returns
None
Example
emergency stop
Block
Description
Stops all commands to motors. The CoDrone will stop flying immediately.
Parameters
None
Returns
None
Example
go [direction] for [duration] seconds
Block
Description
CoDrone moves to a given direction for a given duration, in seconds.
Parameters
direction: the direction of flight
duration: the duration of flight, in seconds
Returns
None
Example
go [direction] for [duration] seconds at [power]% power
Block
Description
CoDrone moves to a given direction for a given duration, in seconds, at a given power.
Parameters
direction: the direction of flight
duration: the duration of flight, in seconds
power: the power/speed of the flight
Returns
None
Example
turn [direction] for [duration] seconds at [power]% power
Block
Description
Turns the CoDrone to a given direction for a given duration, in seconds, at a given power/speed.
Parameters
direction: the direction of turn
duration: the duration of turn, in seconds
power: the power/speed of the turn
Returns
None
Example
turn 180 degrees
Block
Description
Turns around the CoDrone 180 degrees
Parameters
None
Returns
None
Example
hover for [duration] seconds
Block
Description
Makes the CoDrone hover for a given duration in seconds.
Parameters
duration: the time the CoDrone should hover
Returns
None
Example
Flight Sequences
fly in a square
Block
Description
CoDrone flies in a square pattern.
Parameters
None
Returns
None
Example
fly in a circle
Block
Description
CoDrone flies in a circle pattern.
Parameters
None
Returns
None
Example
fly in a spiral
Block
Description
CoDrone flies in a spiral pattern.
Parameters
None
Returns
None
Example
hop forward
Block
Description
CoDrone flies in a forward hop pattern
Parameters
None
Returns
None
Example
sway
Block
Description
CoDrone flies in a swaying pattern.
Parameters
None
Returns
None
Example
zigzag
Block
Description
CoDrone flies in a zigzag pattern.
Parameters
None
Returns
None
Example
Status Checkers
is code 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
None
Example
Sensors
get height from ground
Block
Description
This function returns the current height of the drone from the object directly below its IR sensor.
Parameters
None
Returns
height: The current height above the object directly below the drone’s IR height sensor as an int (mm).
Example
get battery percentage
Block
Description
This function returns the current battery percentage of the CoDrone, from 0 to 100.
Parameters
None
Returns
percentage: The battery’s percentage as an integer from 0 - 100.
Example
get gyro data
Block
Description
This function gets the data from the gyrometer sensor to determine the roll, pitch, and yaw as angles.
Parameters
None
Returns
Returns a list of angles: roll, pitch, and yaw, respectively
Example
Lights
set arm color to [color], with a brightness of [brightness]
Block
Description
CoDrone lights its arms with the given color at a given brightness.
Parameters
color: The color of the arms' LEDs
brightness: The brightness of the arms' LEDs
Returns
None
Example
set arm color to [color], and pattern to [pattern], with a speed of [speed]
Block
Description
CoDrone lights its arms with the given color and given light pattern at a given speed.
Parameters
color: The color of the arms' LEDs
pattern: The lighting pattern of the arms' LEDs
speed: The speed of the lighting pattern
Returns
None
Example
set eye color to [color], with a brightness of [brightness]
Block
Description
CoDrone lights its eyes with the given color at a given brightness.
Parameters
color: The color of the arms' LEDs
brightness: The brightness of the arms' LEDs
Returns
None
Example
set eye color to [color], and pattern to [pattern], with a speed of [speed]
Block
Description
CoDrone lights its eyes with the given color and given light pattern at a given speed.
Parameters
color: The color of the eyes' LEDs
pattern: The lighting pattern of the eyes' LEDs
speed: The speed of the lighting pattern
Returns
None
Example
strobe eye lights
Block
Description
CoDrone turns on strobing effect for eye lights.
Parameters
None
Returns
None
Example
strobe arm lights
Block
Description
CoDrone turns on strobing effect for arm lights.
Parameters
None
Returns
None
Example
turn eyes off
Block
Description
CoDrone's eye lights turn off.
Parameters
None
Returns
None
Example
turn arms off
Block
Description
CoDrone's arm lights turn off.
Parameters
None
Returns
None