Hardware Library

Sphero/Ollie

{"func":"blockSpheroSetSpeed"}

Set Speed

Use "Set Speed" to set Sphero/Ollie to the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"valueSpheroSpeed"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"wrapper","func":"valueSpheroSpeed"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpLess","values":[{"type":"wrapper","func":"valueSpheroSpeed"},{"type":"string","value":"100"}]}],"containers":[{"func":"blockSpheroSetSpeed","values":[{"type":"wrapper","func":"valueOpBinary","values":[{"type":"wrapper","func":"valueSpheroSpeed"},{"type":"choice","value":"+"},{"type":"string","value":"10"}]}]}]}} Add to my Backpack


{"func":"blockSpheroRoll"}

Roll For

Use "Roll For" to roll Sphero/Ollie for the specified time.

Parameters:

Seconds: amount of time to roll

Related Blocks:
{"func":"blockSpheroStop"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"forward"}],"next":{"func":"blockSpheroRoll","values":[{"type":"number","value":"99"}]}} Add to my Backpack


{"func":"blockSpheroStop"}

Stop Moving

Use "Stop Moving" to stop Sphero/Ollie from rolling.

Parameters:

None.

Related Blocks:
{"func":"blockSpheroRoll"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"break"}],"next":{"func":"blockSpheroStop"}} Add to my Backpack


{"func":"blockSpheroTurnCW"}

Turn Clockwise

"Turn Clockwise" turns Sphero/Ollie clockwise by the number of degrees

Parameters:

Angle: number of degrees to turn clockwise

Related Blocks:
{"func":"blockSpheroTurnCCW"} ,     {"func":"blockSpheroHeading"} ,     {"func":"valueSpheroHeading"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"right"}],"next":{"func":"blockSpheroTurnCW","values":[{"type":"string","value":90}]}} Add to my Backpack


{"func":"blockSpheroTurnCCW"}

Turn Counter-Clockwise

"Turn Counter-Clockwise" turns Sphero/Ollie counter-clockwise by the number of degrees

Parameters:

Angle: number of degrees to turn counter-clockwise

Related Blocks:
{"func":"blockSpheroTurnCW"} ,     {"func":"blockSpheroHeading"} ,     {"func":"valueSpheroHeading"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"left"}],"next":{"func":"blockSpheroTurnCCW","values":[{"type":"string","value":90}]}} Add to my Backpack


{"func":"blockSpheroHeading"}

Set Heading

"Set Heading" sets the heading of Sphero/Ollie. 0 is straight ahead.

Parameters:

Angle: number of degrees

Related Blocks:
{"func":"blockSpheroTurnCW"} ,     {"func":"blockSpheroTurnCCW"} ,     {"func":"valueSpheroHeading"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockSpheroHeading","values":[{"type":"string","value":"0"}]}} Add to my Backpack


{"func":"blockSpheroColor"}

Set Color

Use "Set Color" to set the color for the Sphero/Ollie.

Parameters:

Color: color to set to

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"purple"}],"next":{"func":"blockSpheroColor","values":[{"type":"color","value":"#C66BAA"}]}} Add to my Backpack


{"func":"valueSpheroSpeed"}

Speed

"Speed" returns the current speed of the Sphero/Ollie as a percentage.

Parameters:

None.

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"speed up"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueOpLess","values":[{"type":"wrapper","func":"valueSpheroSpeed"},{"type":"string","value":"100"}]}],"containers":[{"func":"blockSpheroSetSpeed","values":[{"type":"wrapper","func":"valueOpBinary","values":[{"type":"wrapper","func":"valueSpheroSpeed"},{"type":"choice","value":"+"},{"type":"string","value":"10"}]}]}]}} Add to my Backpack


{"func":"valueSpheroHeading"}

Heading

"Heading" returns the current heading of Sphero/Ollie.

Parameters:

None.

Related Blocks:
{"func":"blockSpheroTurnCW"} ,     {"func":"blockSpheroTurnCCW"} ,     {"func":"blockSpheroHeading"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"change"}],"next":{"func":"blockSpheroHeading","values":[{"type":"wrapper","func":"valueOpBinary","values":[{"type":"wrapper","func":"valueSpheroHeading"},{"type":"choice","value":"+"},{"type":"string","value":"10"}]}]}} Add to my Backpack


{"func":"valueSpheroConnected"}

Connected?

"Connected?" returns true if connected to Sphero/Ollie; otherwise returns false.

Parameters:

None.

Related Blocks:
{"func":"blockSpheroTurnCW"} ,     {"func":"blockSpheroTurnCCW"} ,     {"func":"blockSpheroRoll"} ,     {"func":"blockSpheroStop"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueSpheroConnected"}],"containers":[{"func":"blockControlBroadcast","values":[{"type":"string","value":"ready"}]}]} Add to my Backpack


{"func":"valueSpheroOdometer"}

Odometer

"Odometer" returns the total distance the device has traveled in centimeters.

Parameters:

None.


{"func":"valueSpheroProperty"}

Get Property

"Get Property" returns the specified device property of the device.

Parameters:

Property: This is the device property to get a value for.


{"func":"registerHardwareTrigger"}

When I collide

"When I collide" is called when the device collides with another object.

Parameters:

None.

Related Blocks:
{"func":"valueSpheroCollidedSinceLastCheck"}


{"func":"valueSpheroCollidedSinceLastCheck"}

collided since last check?

"collided since last check?" returns true if the device has collided with another object since "collided since last check?" was last called.

Parameters:

None.

Related Blocks:
{"func":"registerHardwareTrigger"}


{"func":"blockSpheroSetStabilization"}

set stabilization

"set stabilization" turns on or off internal stabilization of the device. Stabilization is enabled by default when the device is powered up.

Parameters:

Boolean: This parameter should be a boolean value (either true or false). If the value is false, device stabilization will be turned off. If the value is true, device stabilization will be turned on.


{"func":"blockSpheroSet"}

Set Device Value To

"Set Device Value To" sets a configuration value for the device.

Parameters:

Configuration Key: This is the name of a device configuration value.

Value: This is the value to set to.



Drone

{"func":"blockDroneMoveTo"}

Move Drone to

"Move Drone to" is a block that moves the drone to the supplied location.

Parameters:

Location


{"func":"blockDroneMoveBy"}

Move Drone by

"Move Drone by" is a block that moves the drone in the specified drirection and by the specified amount.

Parameters:

Distance


{"func":"blockDroneTurnLeft"}

Turn Left

"Turn Left" is a block that turns the drone's facing direction 90 degrees to the left.

Parameters:

None.


{"func":"blockDroneTurnRight"}

Turn Right

"Turn Right" is a block that turns the drone's facing direction 90 degrees to the right.

Parameters:

None.


{"func":"valueDroneDir"}

Drone Direction

"Drone Direction" is a value block that returns the current direction of the drone.

Parameters:

None.


{"func":"valueDronePosition"}

Drone Location

"Drone Location" is a value block that returns a location object representing the drone's postion.

Parameters:

None.


{"func":"blockDroneSetCheckpoint"}

Set Checkpoint

"Set Checkpoint" is a block that saves the drone's current location as a checkpoint with a specified name.

Parameters:

Location

Name


{"func":"blockDroneGoCheckpoint"}

Go to Checkpoint

"Go to Checkpoint" is a block that moves the drone to the checkpoint that matches the specified name.

Parameters:

Name


{"func":"blockDronePutBlock"}

Place Block

"Place Block" is a block that places a block of the specified type at the drone's current location.

Parameters:

Block


{"func":"blockDroneLineTo"}

Place Blocks on Line

"Place Blocks in Line" is a block that places series of blocks on a line between the drone's current location and the supplied location.

Parameters:

Block

Location


{"func":"blockDroneRect"}

Craft Box

"Build Box" is a block that places a filled or hollow box of blocks of the specified type and with the specified dimensions at the drone's curent location.

Parameters:

Filled

Block

Width

Height

Depth


{"func":"blockDroneCylinder"}

Craft Cylinder

"Build Cylinder" is a block that places a filled or hollow cylinder of blocks of the specified type and with the specified dimensions at the drone's curent location.

Parameters:

Filled

Block

Radius

Length

Wall Thickness

Direction


{"func":"blockDroneSphere"}

Craft Sphere

"Build Sphere" is a block that places a filled or hollow sphere of blocks of the specified type and with the specified dimensions at the drone's curent location.

Parameters:

Filled

Block

Radius


{"func":"blockDroneHemisphere"}

Craft Hemisphere

"Build Hemisphere" is a block that places a filled or hollow hemisphere of blocks of the specified type and with the specified dimensions at the drone's curent location.

Parameters:

Filled

Top

Block

Radius


{"func":"blockDronePrism"}

Craft Prism

"Build Prism" builds a prism out of the blocks specified at the drone's current location, extending in front of the drone for the specified width and height.

Parameters:

Block

Width

Depth


{"func":"blockDroneBlocktype"}

Write Text with Blocks

"Write Text with Blocks" writes letters in Minecraft blocks at the drone's current location.

Parameters:

Block

Text


{"func":"blockDroneSign"}

Craft Sign

"Build Sign" is a block that puts down sign post or wall sign at the drone's current location with the given messages.

Parameters:

SignType

Message 1

Message 2

Message 3

Message 4


{"func":"blockDroneDoor"}

Place Door

"Place Door" will place a door, or side-by-side double-doors, at the current drone position.

Parameters:

Width

Door


{"func":"blockDroneBed"}

Place Bed

"Place Bed" will place the foot of a bed at the drone's current location and the head of the bed 1 block in front of the drone.

Parameters:

None.


{"func":"blockDroneLadder"}

Place Ladder

"Place Ladder" This will place a climbable ladder at the drone's location extending upward the specified number of units.

Parameters:

Height

Sample Code:
{"cat":"drone","label":"place ladder with height:{number:1}","func":"blockDroneLadder"} Add to my Backpack


{"func":"blockDroneStairs"}

Place Staircase

"Place Staircase" builds a staircase at the drone's current location, extending in front of the drone for the specified width and height.

Parameters:

Staircase

Width

Height


{"func":"blockDroneCottage"}

Craft Cottage

"Craft Cottage" This builds a small cottage at the drone's current location.

Parameters:

None.


{"func":"blockDroneCottageRoad"}

Craft Road With Cottages

"Craft Road With Cottages" This will create a straight road with cottages on both sides. The number of cottages MUST be a multiple of 2, and the default is 6.

Parameters:

Number


{"func":"blockDroneCreateTree"}

Plant Tree

"Plant Tree" is a block that plants a tree of the specified kind at the drone's current location.

Parameters:

Tree


{"func":"blockDronePointCardinalDirection"}

Set Drone Direction

"Point Drone Direction" is a block that sets the direction of the drone

Parameters:

Direction


{"func":"blockDroneTakeOff"}

Take Off

"Take Off" makes the Parrot drone take off.

Parameters:

None.

Related Blocks:
{"func":"blockDroneLand"} ,     {"func":"blockDroneEmergency"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"takeoff"}],"next":{"func":"blockDroneTakeOff","next":{"func":"blockControlWait","values":[{"type":"number","value":"1000"}]}}} Add to my Backpack


{"func":"blockDroneLand"}

Land

"Land" makes the Parrot drone land.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakeOff"} ,     {"func":"blockDroneEmergency"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"land"}],"next":{"func":"blockDroneLand"}} Add to my Backpack


{"func":"blockDroneStop"}

Stop

"Stop" stops the Parrot drone from moving and puts it into a hover state.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakeOff"} ,     {"func":"blockDroneLand"} ,     {"func":"blockDroneEmergency"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"stop"}],"next":{"func":"blockDroneStop"}} Add to my Backpack


{"func":"blockDroneEmergency"}

Emergency

"Emergency" cuts off power to the Parrot drone.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakeOff"} ,     {"func":"blockDroneLand"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"emergency"}],"next":{"func":"blockDroneEmergency"}} Add to my Backpack


{"func":"blockDroneSetSpeed"}

Set Speed

Use "Set Speed" to set Parrot drone to the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneBackward"} ,     {"func":"blockDroneLeft"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockDroneSetSpeed","values":[{"type":"number","value":"50"}]}} Add to my Backpack


{"func":"blockDroneForward"}

Fly Forward

"Fly Forward" moves the Parrot drone forward at the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneBackward"} ,     {"func":"blockDroneLeft"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"forward"}],"next":{"func":"blockDroneForward","values":[{"type":"number","value":"1"}]}} Add to my Backpack


{"func":"blockDroneBackward"}

Fly Backward

"Fly Backward" moves the Parrot drone backward at the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneLeft"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"backward"}],"next":{"func":"blockDroneBackward","values":[{"type":"number","value":"1"}]}} Add to my Backpack


{"func":"blockDroneLeft"}

Bank Left

"Bank Left" moves the Parrot drone left at the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneBackward"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"left"}],"next":{"func":"blockDroneLeft","values":[{"type":"number","value":"1"}]}} Add to my Backpack


{"func":"blockDroneRight"}

Bank Right

"Bank Right" moves the Parrot drone right at the specified speed.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneBackward"} ,     {"func":"blockDroneLeft"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"right"}],"next":{"func":"blockDroneRight","values":[{"type":"number","value":"1"}]}} Add to my Backpack


{"func":"blockDroneTurnCW"}

Turn Clockwise

"Turn Clockwise" turns the Parrot drone clockwise at the specified angle.

Parameters:

Angle: number of degrees to turn clockwise

Related Blocks:
{"func":"blockDroneTurnCCW"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"turn right"}],"next":{"func":"blockDroneTurnCW","values":[{"type":"string","value":30}]}} Add to my Backpack


{"func":"blockDroneTurnCCW"}

Turn Counter-Clockwise

"Turn Counter-Clockwise" turns the Parrot drone counter-clockwise at the specified angle.

Parameters:

Angle: number of degrees to turn clockwise

Related Blocks:
{"func":"blockDroneTurnCW"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"turn left"}],"next":{"func":"blockDroneTurnCCW","values":[{"type":"string","value":30}]}} Add to my Backpack


{"func":"blockDroneAnimation"}

Flip

Use "Flip" to flip the Parrot drone while flying.

Parameters:

Direction: direction to flip - forward, backward, left or right.

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneBackward"} ,     {"func":"blockDroneLeft"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"back flip"}],"next":{"func":"blockDroneAnimation","values":[{"type":"string","value":"flip backward"}]}} Add to my Backpack


{"func":"blockDroneUp"}

Fly Up

"Fly Up" moves the Parrot drone upwards.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneDown"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"rise"}],"next":{"func":"blockDroneUp","values":[{"type":"number","value":".5"}]}} Add to my Backpack


{"func":"blockDroneDown"}

Fly Down

"Fly Down" moves the Parrot drone downwards.

Parameters:

Speed: percentage speed

Related Blocks:
{"func":"blockDroneUp"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"lower"}],"next":{"func":"blockDroneDown","values":[{"type":"number","value":".5"}]}} Add to my Backpack


{"func":"valueDroneConnected"}

Connected?

"Connected?" returns true if connected to Parrot drone; otherwise returns false.

Parameters:

None.

Related Blocks:
{"func":"blockDroneForward"} ,     {"func":"blockDroneBackward"} ,     {"func":"blockDroneLeft"} ,     {"func":"blockDroneRight"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueDroneConnected"}],"containers":[{"func":"blockControlBroadcast","values":[{"type":"string","value":"ready"}]}]} Add to my Backpack


{"func":"blockDroneStartUp"}

Start Moving Up

"Start Moving Up" starts the Parrot drone moving up. The drone continues moving up until it receives a "Stop", a "Start Moving Down", a "Move Down For", or an "Emergency" command.

Parameters:

None.

Related Blocks:
{"func":"blockDroneUp"} ,     {"func":"blockDroneDown"} ,     {"func":"blockDroneStartDown"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"up"}],"next":{"func":"blockDroneStartUp"}} Add to my Backpack


{"func":"blockDroneStartDown"}

Start Moving Down

"Start Moving Down" starts the Parrot drone moving down. The drone continues moving down until it receives a "Stop", a "Start Moving Up", a "Move Up For", or an "Emergency" command.

Parameters:

None.

Related Blocks:
{"func":"blockDroneDown"} ,     {"func":"blockDroneUp"} ,     {"func":"blockDroneStartUp"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"down"}],"next":{"func":"blockDroneStartDown"}} Add to my Backpack


{"func":"blockDroneStartRotateLeft"}

Start Rotating Left

"Start Rotating Left" starts the Parrot drone rotating counter-clockwise. The drone continues rotating until it receives a "Stop", a "Start Rotating Right", a "Rotate Right", or an "Emergency" command.

Parameters:

None.

Related Blocks:
{"func":"blockDroneStartRotateRight"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"rotate left"}],"next":{"func":"blockDroneStartRotateLeft"}} Add to my Backpack


{"func":"blockDroneStartRotateRight"}

Start Rotating Right

"Start Rotating Right" starts the Parrot drone rotating counter-clockwise. The drone continues rotating until it receives a "Stop", a "Start Rotating Left", a "Rotate Left", or an "Emergency" command.

Parameters:

None.

Related Blocks:
{"func":"blockDroneStartRotateLeft"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"rotate right"}],"next":{"func":"blockDroneStartRotateRight"}} Add to my Backpack


{"func":"blockDroneSetProductName"}

Set Drone Name To

"Set Drone Name To" changes the name of the Parrot drone. After running this block, turn the drone off. Then turn the drone back on and it will have a new name.

Parameters:

String: The new name of the drone.

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockDroneSetProductName","values":[{"type":"string","value":"Codey"}],"containers":[]}} Add to my Backpack


{"func":"blockDroneTakePicture"}

Take Picture

"Take Picture" takes a picture with the drone's camera. If the camera is busy, no picture will be taken. The picture is saved on the drone. To copy the picture to your tablet, use "Fetch Picture From Drone."

Parameters:

None.

Related Blocks:
{"func":"blockDroneFetchPicture"} ,     {"func":"blockDroneDeletePicture"} ,     {"func":"blockDroneVarSetNumPictures"}

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockDroneTakePicture"}} Add to my Backpack


{"func":"blockDroneFetchPicture"}

Fetch Picture From Drone

"Fetch Picture From Drone" copies the most recently taken picture from the drone to the tablet's Photos. Coping a picture can take 10 seconds or longer. This block does nothing if a picture is already being fetched.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakePicture"} ,     {"func":"blockDroneDeletePicture"} ,     {"func":"blockDroneVarSetNumPictures"}

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockLooksSay","values":[{"type":"string","value":"Fetching picture..."}],"containers":[],"next":{"func":"blockDroneFetchPicture","values":[],"containers":[],"next":{"func":"blockLooksSay","values":[{"type":"string","value":"Finished fetching picture."}],"containers":[]}}}} Add to my Backpack


{"func":"blockDroneDeletePicture"}

Delete Picture On Drone

"Delete Picture On Drone" deletes the most recently taken picture from the drone.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakePicture"} ,     {"func":"blockDroneFetchPicture"} ,     {"func":"blockDroneVarSetNumPictures"}

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockDroneDeletePicture"}} Add to my Backpack


{"func":"blockDroneVarSetNumPictures"}

Set variable to Number of Pictures on Drone

"Set variable to Number of Pictures on Drone" downloads the number of pictures on a drone. This number is saved to a variable.

Parameters:

None.

Related Blocks:
{"func":"blockDroneTakePicture"} ,     {"func":"blockDroneFetchPicture"} ,     {"func":"blockDroneDeletePicture"}

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockControlScriptVar","label":"","values":[{"type":"wrapper","func":"valueScriptVar","name":"count"}],"containers":[],"next":{"func":"blockDroneVarSetNumPictures","values":[{"type":"wrapper","func":"valueScriptVar","name":"count"}],"containers":[],"next":{"func":"blockLooksSay","values":[{"type":"wrapper","func":"valueScriptVar","name":"count"}],"containers":[]}}}} Add to my Backpack


{"func":"valueDroneHasGrabber"}

Has Grabber?

"Has Grabber?" returns true if a Parrot Mambo drone has a grabber. It returns false otherwise.

Parameters:

None.

Related Blocks:
{"func":"blockDroneControlGrabber"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueDroneHasGrabber","values":[]}],"containers":[{"func":"blockDroneControlGrabber","values":[{"type":"string","value":"close"}],"containers":[]}]} Add to my Backpack


{"func":"blockDroneControlGrabber"}

Control Grabber

"Control Grabber" opens or closes the grabber.

Parameters:

Grabber command: Either "Open" or "Close".

Related Blocks:
{"func":"valueDroneHasGrabber"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueDroneHasGrabber","values":[]}],"containers":[{"func":"blockDroneControlGrabber","values":[{"type":"string","value":"close"}],"containers":[]}]} Add to my Backpack


{"func":"valueDroneHasCannon"}

Has Cannon?

"Has Cannon?" returns true if a Parrot Mambo drone has a cannon. It returns false otherwise.

Parameters:

None.

Related Blocks:
{"func":"blockDroneControlCannon"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueDroneHasCannon","values":[]}],"containers":[{"func":"blockDroneControlCannon","values":[],"containers":[]}]} Add to my Backpack


{"func":"blockDroneControlCannon"}

Fire Cannon

"Fire Cannon" launches a ball from the cannon.

Parameters:

None.

Related Blocks:
{"func":"valueDroneHasCannon"}

Sample Code:
{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueDroneHasCannon","values":[]}],"containers":[{"func":"blockDroneControlCannon","values":[],"containers":[]}]} Add to my Backpack


{"func":"blockDroneSetFlyingMode"}

Set Flying Mode

"Set Flying Mode" changes the Swing from a quadcopter to a plane. Once the Swing enters plane mode, it will immediately start flying. It will keep on flying until your program excutes a quadcopter block or you stop your program.

Parameters:

Flying mode: Either "Quadcopter", "Plane Forward" or "Plane Backwards".

Related Blocks:
{"func":"blockDroneSetFlyingMode"}

Sample Code:
{"func":"registerSpriteTrigger","values":[],"containers":[],"next":{"func":"blockDroneTakeOff","values":[],"containers":[],"next":{"func":"blockDroneSetFlyingMode","values":[{"type":"string","value":"plane forward"}],"containers":[]}}} Add to my Backpack



Hue

{"func":"blockHueState"}

Turn Light On/Off

"Turn Light On/Off" turns the Philips Hue light on (true) or off (false).

Parameters:

State: true - on, false - off

Related Blocks:
{"func":"valueHueState"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockHueState","values":[{"type":"boolean","value":"true"}]}} Add to my Backpack


{"func":"valueHueState"}

On?

"On?" returns whether the Philips Hue light is on (true) or off (false).

Parameters:

None.

Related Blocks:
{"func":"blockHueState"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"turn off"}],"next":{"func":"blockControlIf","values":[{"type":"wrapper","func":"valueHueState"}],"containers":[{"func":"blockHueState","values":[{"type":"boolean","value":"false"}]}]}} Add to my Backpack


{"func":"blockHueColor"}

Set Color

"Set Color" sets the RGB color for the Philips Hue light.

Parameters:

Color: This is the color value

Related Blocks:
{"func":"blockHueSetHue"} ,     {"func":"blockHueChangeHue"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockHueState","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockHueColor","values":[{"type":"color","value":"#ff0000"}]}}} Add to my Backpack


{"func":"blockHueSetHue"}

Set Color Hue

"Set Color Hue" sets the color hue for the Philips Hue light.

Parameters:

Hue: color hue from 0-100

Related Blocks:
{"func":"blockHueColor"} ,     {"func":"blockHueChangeHue"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockHueState","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockHueSetHue","values":[{"type":"number","value":"35"}]}}} Add to my Backpack


{"func":"blockHueChangeHue"}

Change Color Hue By

"Change Color Hue By" changes the color hue for the Philips Hue light.

Parameters:

Amount: amount to change the hue by

Related Blocks:
{"func":"blockHueColor"} ,     {"func":"blockHueSetHue"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"red"}],"next":{"func":"blockHueChangeHue","values":[{"type":"number","value":"-5"}]}} Add to my Backpack


{"func":"blockHueBrightness"}

Set Brightness

"Set Brightness" sets the brightness for the Philips Hue light.

Parameters:

Brightness: the brightness (0-100)

Related Blocks:
{"func":"valueHueBrightness"}

Sample Code:
{"func":"registerFlagTrigger","next":{"func":"blockHueState","values":[{"type":"boolean","value":"true"}],"next":{"func":"blockHueBrightness","values":[{"type":"number","value":"100"}]}}} Add to my Backpack


{"func":"valueHueBrightness"}

Brightness

"Brightness" returns the current Philips Hue light brightness (from 0-100).

Parameters:

None.

Related Blocks:
{"func":"blockHueBrightness"}

Sample Code:
{"func":"registerBroadcastTrigger","values":[{"type":"string","value":"dim"}],"next":{"func":"blockHueBrightness","values":[{"type":"wrapper","func":"valueOpBinary","values":[{"type":"wrapper","func":"valueHueBrightness"},{"type":"choice","value":"-"},{"type":"string","value":"10"}]}]}} Add to my Backpack


{"type":"wrapper","func":"valueTynkerVMLightVisible","values":[]}

Get Visible Light

"Get Visible Light" returns the current ambient light surrounding the micro:bit.

Parameters:

None.

Related Blocks:
{"func":"valueTynkerVMAccel"} ,     {"func":"valueTynkerVMTemperature"} ,     {"func":"valueTynkerVMLightIR"}

Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockVarSet","values":[{"type":"string","value":"temperature"},{"type":"wrapper","func":"valueTynkerVMTemperature","values":[]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"accel_x"},{"type":"wrapper","func":"valueTynkerVMAccel","values":[{"type":"choice","value":"x"}]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"visible_light"},{"type":"wrapper","func":"valueTynkerVMLightVisible","values":[]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"infrared_light"},{"type":"wrapper","func":"valueTynkerVMLightIR","values":[]}]}}}}} Add to my Backpack


{"type":"wrapper","func":"valueTynkerVMLightIR","values":[]}

Get Infrared Light

"Get Infrared Light" returns the current ambient infrared light surrounding the micro:bit.

Parameters:

None.

Related Blocks:
{"func":"valueTynkerVMAccel"} ,     {"func":"valueTynkerVMTemperature"} ,     {"func":"valueTynkerVMLightVisible"}

Sample Code:
{"func":"registerFlagTrigger","values":[],"next":{"func":"blockVarSet","values":[{"type":"string","value":"temperature"},{"type":"wrapper","func":"valueTynkerVMTemperature","values":[]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"accel_x"},{"type":"wrapper","func":"valueTynkerVMAccel","values":[{"type":"choice","value":"x"}]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"visible_light"},{"type":"wrapper","func":"valueTynkerVMLightVisible","values":[]}],"next":{"func":"blockVarSet","values":[{"type":"string","value":"infrared_light"},{"type":"wrapper","func":"valueTynkerVMLightIR","values":[]}]}}}}} Add to my Backpack