Getting Started with ZubiFlyer ScratchX

 

The Zubi Flyer bridges virtual and physical worlds.  Using free open-source development environments you can easily write commands and scripts that turn your Zubi Flyer into an interactive controller.  Using drag and drop Scratch Blocks or real code with the Arduino development environment you can program and share interactive media such as stories, games, and animation with people from all over the world.  

 

1) Setup Your Zubi Flyer for Arduino & ScratchX  

  1. First, you will need to setup your Zubi Flyer to code using Arduino.  

    This is the same setup required to modify the 12 fun games that come pre-installed on your Zubi Flyer.  

    If you have already competed this setup - in other words, you have already opened Arduino and uploaded modified code to your Zubi Flyer printed circuit board - you can jump on over to the next step, 1.2.

    Otherwise, CLICK HERE for the Fuze Install Kit that will allow you to code your Zubi Flyer with Arduino!

  2. Second, to use your Zubi Flyer with Scratch you will need to setup the FuzePlay ScratchX Extension AND upload special code to your Zubi Flyer using Arduino.  

    CLICK HERE for instructions on setting up the FuzePlay ScratchX Extension.

 

2) INTRO TO SCRATCH BLOCK SHAPES

In Scratch there are six different block shapes: Hat, Stack, Boolean, Reporter, C and Cap.

Hat Blocks scratch hat block

Hat blocks are the blocks that start every script. They are shaped with a rounded top and a bump at the bottom — this is so you can only place blocks below them. There are 11 Hat blocks, six of which are in the Events category, one in the Control category, and four More hat blocks.

Stack Blocksscratch stack block

Stack blocks are the blocks that perform the main commands. They are shaped with a notch at the top and a bump on the bottom — this is so blocks can be placed above and below them. There are 77 Stack blocks — the most common block shape. 

Boolean Blocksboolean scratch blocks

Boolean blocks are the conditions — they are either true or false. It's like asking your friend: "Does 2 + 2 = 4?", and they would either tell you "Yes" or "No". With a hexagonal shape, there are 13 of these blocks.

Reporter Blocksscratch reporter block

Reporter blocks are the values. Reporter blocks can hold numbers and strings. It is like asking a friend, for example, "What is 2 + 2?", and they would answer "4". It is not just equations however, it can report a variable, for example, "What is your age?". They may answer: "15". Shaped with rounded edges, there are 37 of these blocks — not counting the theoretically infinite amount of Reporter blocks that can be made for each variable and list.

C Blocks scratch c blocks

C blocks are blocks that take the shape of "C's". Also known as "Wrap blocks", these blocks loop the blocks within the Cs or check if a condition is true. There are five C blocks, and they can be found in the Control category. C blocks can be bumped at the bottom, or capped.

Cap Blocks scratch cap blocks

Cap blocks are the blocks that end scripts. They are shaped with a notch at the top and a flat bottom — this is so you cannot place any blocks below them. There are two Cap blocks which can both be found in the Control category.

 

2) RUN ZUBI FLYER ON SCRATCH

*Because the FuzePlay ScratchX Extension is in beta, you must use a Safari browser

    1. Go to Scratchx.org in a Safari browser window. 
    2. Click 'Open Extension URL'.

      ScratchX Open Extension URL

    3. Paste the following URL into the pop up window: 

      https://raw.githubusercontent.com/fuzeplay/scratch-arduino-extension/original-pin-values/arduino_extension.js

      ScratchX Open an Extension URL Link
    4. Click 'I understand, continue' when the experimental warning box pops up.

      ScratchX Experimental Warning

3) Green Means Go!

 

Confirm your Zubi Flyer board is connected by plugging it into the USB port on your computer.  You should see the Zubi Flyer light turn from Yellow > Green.

scratch zubi flyer connection yellow scratch zubi flyer connection green

As long as you seen a green dot on your screen your Zubi Flyer will be communicating with Scratch.  Anything you do online will be programmed to your board!! 

More Blocks

Notice the 'More Blocks' section.  These blocks are specific to your Zubi Flyer.  We will come back to them in a minute! 

scratch-zubi-flyer-more-blocks

Add A Sprite In Scratch

Before we drag and drop blocks - add our Sprite.  In this case we have added two!

The Sprite labeled as #1 was added from a file we had on our computer.  Sprite #2 was added directly from Scratch.  Try whichever seems like more fun for you! 

Make sure you pay attention which Sprite is selected.  You will drop blocks for the selected Sprite since each sprite is controlled independently.  

In this example our Dinosaur Sprite is selected and blocks have been dropped commanding it to say, "Hello FuzePlay!"  

scratch-add-a-sprite

Looks Blocks and Control Blocks

In Scratch the Looks Blocks are the most widely used out of all the blocks! 

We wanted to say, "Hello," so w dragged in the 'Say Hello!' block.  Notice you can change 'Hello!' to whatever you want.  We added 'Hello Fuze Play!'.  

 

scratch looks blocks

 

Because we wanted to create greeting, we wanted our Dinosaur to say hello 'forever'.  To do this we dragged a 'forever' block from the Control Block category in Scratch.

 

scratch control blocks 

In this example we added one more block!  We really did . . .

We only wanted our greeting to take place when the Zubi Flyer PCB was plugged in and part of the party!!

We dragged a Hat Block that causes everything under it to start - in this case the script will start when the Zubi Flyer 'device is connected' (ie Zubi Flyer circle is GREEN, not YELLOW). 

 

scratch more blocks 

Reporter Blocks and Zubi Flyer Light Sensor 

In 'More Blocks' find the 'read light sensor' reporter block.  

Drag this block and replace 'Hello Fuze Play!'.  

You should see our Dinosaur friend being to report the amount of light hitting the photocell our your Zubi Flyer.  Try using your hand to cover up the sensor and watching the number change! 

 

scratch reporter block

Motion Blocks and Sound Blocks 

Let's have our Dinosaur do a little dance.  

Drag over a few sound blocks for fun.  There are thirteen to chose from.  Our pick was the drum #1 for the first block and drum #2 for the second.  We decided to have each drum play for half a beat.    

Make sure to connect each drum beat by stacking them on top of each other.  

 

scratch sound blocks

 

It doesn't matter which block you add first.  In this example we added the motion blocks second.  

There are seventeen motion block to choose from.  This dance is going to be simple - a step forward and a step back with a drum beat in between.  

Drag the 'move 10 steps' Motion Block between the two Sound Blocks.  Then drag another Motion Block and stack beneath the second Sound Block.  

Notice a couple things:

We changed the number of steps from '10' to '30' so it is visually more obvious. 

This is a dance (step forward, step back), so we changed the second step to '-30'. The second step is negative, indicating it is a step backward, not another step forward.  

Click on the block set you just created to run the script.  

scratch motion blocks

 

More Blocks and Zubi Flyer LEDs

Click back to More Blocks. 

We want our dance to be triggered by the photocell light sensor.  We dragged in a Hat Block that will trigger a series of blocks if the light sensor is above or below a reading you set.  

Since we are in a very bright room, after testing by waving our hand we set the code to run if the light sensor drops below 70% (the light sensor will show a reading 0-100).

After each drum beat we wanted the LEDs on the Zubi Flyer to change color.  You can see one is set to change to red, and the other blue.  The last block turns all LEDs off until the script is triggered again!  

Lastly, we dragged in a two Control Blocks to create a delay that would allow us to see the light colors longer. 

 

scratch more blocks light sensor

 

Switch Sprites and Zubi Flyer Push Buttons and Reed Switches 

To control a new Sprite you will need to click into that Sprite. 

scratch zubi sprite

We added a quick stack of code blocks you can easy add using the instructions above.

Now, by pressing the triangle button OR by using the reed switch next to the triangle button Zubi will do a dance and then all lights on the Zubi Flyer printed circuit board will turn bright white.  

Wave your hand over the photocell and our Dinosaur will come to life changing the colors again.  

scratch new sprite dance

Explore Scratch More

explore scratch infographic

Scratch Tips

scratch-tips-infographic

Tech Specs

Code Zubi Flyer With Arduino 

Click HERE for the Fuze Install Kit

Code Zubi Flyer With ScratchX 

Click HERE to beta the Fuze ScratchX Extension

In The Box 

Built-In Features

Electronics Parts

Microcontroller Specs 

The Zubi Flyer is the bomb dot com for makers: 5 PWM pins, 12 DIOs as well as hardware serial connections Rx and Tx. Running at 16MHz and 5V. The onboard switch-mode boost regulator is designed to operate on 3 Volts.  Power can be supplied from a 3 Volt CR123A battery or from a USB cable that provides regulated +5 Volts DC to the board. Do not run any power exceeding 5 Volts as the regulator cannot handle step-down voltage.

System Requirements

learn how stuff works!

stars in space on way to mars