FireBlock's First Project

来自Firefly wiki
跳转至: 导航搜索

Introduction

After FireBlock connects with Fireduino board successfully, we now introduce how to control Fireduino board by FireBlock, with some simple examples.


Blink

The classic example is blinking the LED. Fireduino has two builtin LEDs, which connect with digital pin 3 and 13 correspondingly. We can test the LEDs without external circuits.


Blocks

Drag all the blocks needed to the scripting area. Please note, you may need to scroll the gray scroll bar on the right side to see the block.

Category Block
Fireblock quickstart cat control en.png Fireblock quickstart block green flag en.png Fireblock quickstart block wait en.png Fireblock quickstart block loop en.png
Fireblock quickstart cat op en.png Fireblock quickstart block truefalse en.png
Fireblock quickstart cat fireduino en.png Fireblock quickstart block digital write en.png


Put all the blocks in the scripting area:

Fireblock first 1 en.png


Build

We control the LED with digital pin 3 below.


Click the dropdown icon of Fireblock quickstart block digital write en.png. In the popup list, select 3 (Note: if the popup list is empty, it means that FireBlock is unable to connect with Fireduino successfully, hence there is no pin information fetched from the board.):

Fireblock first 2 en.png


The LED is on with low voltage input, and off with high.

The second parameter of Fireblock quickstart block digital write en.png accepts boolean type value of "false" and "true", which coresponds to the "low" and "high" voltage on the board.

Now drag Fireblock quickstart block truefalse en.png into the second slot:

Fireblock first 3 en.png


and get:

Fireblock first 4 en.png


Put Fireblock quickstart block loop en.png beneath Fireblock quickstart block green flag en.png:

Fireblock first 5 en.png


Then put all the rest blocks into Fireblock quickstart block loop en.png with the order below:

Fireblock first 6 en.png


Finally get:

Fireblock first 7 en.png


All done!


Run

Before run, please make sure FireBlock has connected with Fireduino board.


Click the flag Fireblock quickstart icon flag.png above the stage to run. There is light glow around the blocks under running, as shown below:

Fireblock first 8 en.png


The LED will blink now.


To stop, please click the Fireblock quickstart icon stop.png above the stage.