EFBlock

From Wiki

Jump to: navigation, search

Contents

Software Interface Description

Hello, welcome to the world of Arduino. Through the study of this tutorial, you can grasp how to use EFBlock to control your Arduino board and sensors as you master these basic but practical knowledge, you can DIY, use a variety of sensors and the Arduino boards to achieve various functions, don’t waste your creativity. Download EFBlock from: http://elecfreaks.com/estore/download/starterkit/EFBlock.zip Let's take a look at the software: The installation of the software is very simple, keep pressing “next”, and finally “finish”. Nothing needs to pay attention to . Open the software: This is our main interface. Simple configuration first: (at the beginning, the robot module is empty) Click on “Extension” in the menu bar and select “elecfreaks” (so the robot module isn’t empty now). Here we have finished the configuration. After configuration, let’s see what happen with the software interface.

Play Scratch with Arduino-EFBlock Catalog

1. Software interface description

http://elecfreaks.com/estore/download/starterkit/EFBlock.zip

EFB
EFB

After configuration, let’s see what happen with the software interface?

EFB


"New ": create a new project “Load Project”: open up the existing project "Save Project": save the current project to a local file (suffix.Sb2)

(at the beginning, or when you find the robot module is empty, check whether the state of control panel is “Freaduino_uno” and the state of extended menu is “Elecfreaks”)

EFB
EFB
EFB

The scripts are divided by colors.

EFB
: Blue scripts belong to the robot module.
EFB
: Yellow scripts belong to the control module.
EFB
: Orange scripts belong to the data & instructions module.
EFB
: Green scripts belong to the digital & logical operations module.

The robot module is corresponding to our peripheral sensor, connect the sensor to the corresponding interface (IO) if you want to use the corresponding script blocks. Here is one illustration: We have 4 script blocks corresponding to 4 different functions:

EFB

This block is the head of your program, which must be used at the top.

EFB

This block is used for connecting.

EFB

This block represents as a numerical value.

EFB

This block is usually used to judge the condition: yes/no. Now let’s go for what the text stands for.

The first white circle (
EFB
)of most building blocks display the interface,which you may be puzzled about:

Interface is the needle on motherboard. We use wire to connect the sensor and fill in the number of corresponding interface in the first circle, then the building blocks can be used. Arduino has two types of interfaces: Analog and Digital, which are abbreviated as “A” and “D” on the board.So check the letter “A”( A_ for analog and _ for digital) before you connect the sensor(e.g. A0/0).

EFB
 : Analog
EFB
 : Digital
Such as
EFB
, with “A” ahead and “0” in the circle, we should connect the button to A0 side of the board. (The color of wire & interface must be matched .)

We will introduce other scripts later.

2. Let's light up the world of Arduino

We will start with a simple experiment: Light a lamp with flash on the Freaduino board.

EFB
.
EFB
.
EFB
.
EFB
.

You will get this:

EFB
.

The blue blocks belong to the robot module and the yellow blocks belong to the control module.

EFB
.
EFB
.

Note: Input 13 in the white circle in place of 5 in this robot module

EFB
.
EFB
.

Here we finished our first project which is simple but important.

3. How to light the led with a button

Learning objectives: Control the LED lights by the button Required electronic module:

Freaduino motherboard x1

Led block x1

Button block x1


Appearance:

EFB
.


Knowledge points: Blocks Usage

EFB
.

Represent the Arduino program,which could be burnt into Arduino motherboard.

EFB
.

Repeat implementing the scripts.

EFB
.

“if<condition>then”:If condition establishes,implement the scripts, if else then skip.

EFB
.

Wait for 1 second, integers and decimal are both available.

EFB
.

Wait until button are pressed, blue blocks can be replaced with other hexagonal blocks.

EFB
.

Light the led connected with D5 port(HIGH refers on,LOW refers off)

Example:

EFB
.

Flow chart:

Just have a try.

Let's review the steps:

4. How to control a rotating fan

Imagine that the fan rotates when you are close and stops when you leave - let’s build this system on elecfreaks now! Learning objectives: The induction of human body Required electronic module:

Freaduino motherboard x1


Mini fan x1



Appearance:

EFB
.


Knowledge points:

EFB
.

Represent the Arduino program,which could be burnt into Arduino motherboard.

EFB
.

Repeat implementing the scripts.

EFB
.

“if<condition>then”:If condition establishes,implement the scripts,if else then skip.

EFB
.

Return true when situation meets the condition ,or return false.

EFB
.

Wait for 5 seconds.

EFB
.

Set the speed of fan(0 represents off work).

Integrated system:

EFB
.

Flow chart: 01. Set up the program. 02. Repeat the flowing statements. 03. Judge the exist of human body. 04. Fan works when human gets close to(speed as set before),lasts for 5 seconds. 05. Fan stops when human leaves.

Just a few lines will you build the system with induction function, easier than what you have thought about right? Here is what Arduino does, simplifying the complicated. Then connect PIR to A0 and the fan to D6, input the program, you will finish it. Expand:

How to achieve? Think about it.

(Remind:
EFB
)

5. How to light the induction fan

We have learned two small systems, which will help you be familiar with the software interface and operating procedures.

Now let’s turn to a new block type:
EFB


EFB
.

*Operations: plus, minus, multiply, divide.

EFB
.
EFB
.
EFB
.
*Value comparison.
EFB
.

*Random number.

EFB
.

* “and”:True with both conditions.

If button A is not pressed,the result is true.

We will build a light induction fan after you have finished the knowledge above. Required electronic module:

EFB
.


Knowledge points:

EFB
.

*Get the intensity of light (Recognize darkness around, value under 10 represents dark while the highest is 512.)

EFB
.

*Set the speed of fan(0 represents off work).

So you will find that the highest value of light intensity can be up to 512 while the highest rotation speed is 255.

EFB
.

How to solve this problem?

EFB
.

Applying various operators flexibly and you will solve lots of problems smoothly. Remember the human body induction fan with adjust to temperature we mentioned in the last chapter?Then how can we improve the system with this block? Answer: Of course.For example, we can set the system into the case that fan begin to run only if the temperature is higher than a certain value.  

6. Play with the corridor lights


EFB
.

Here are three conditions:

Required electronic modules :




EFB
.
EFB
.
EFB
.

7. What’s the temperature today

EFB
.

Click “Make a Variable”:

EFB
.

Input the name of your new variable and click “OK”.

EFB
.

Now we built a new variable.

instruction examples

EFB
.
EFB
.

Plus 1 to the value of variable, negative is also available.


Freaduino motherboard x1

Temperature and humidity sensor x1

0.36 inch digital tube (small) x1
EFB

Blocks Usage

EFB
.

Read the value of temperature and humidity of the related sensor (DTH11).

EFB
.

Display of digital tube; Numbers and variables are available filled in the blank. (Connect CLK to A4 and DIO to A5).

  System implementation:

EFB
.

Here is one reference:

EFB
.

Now I believe you have some knowledge about this system, the next is up to you, think over and try a lot, don’t waste your creativity, do something awesome.

Personal tools
Namespaces
Variants
Actions
Navigation
Support
Toolbox