精品导航

Types of blocks

There are a total of nine block types in CB. Each of them is represented by their own color. Every block translates to code, which is then compiled and uploaded to the phone, just like on every Arduino based platform.


Pressing on every block type will open a section from which you can drag-and-drop those blocks into the drawing area.
Also, pressing on ‘More’ will open even more blocks that are not so commonly used.
There are two main functions of every Arduino code – void setup() and void loop().
Everything that goes into the void setup() the function will run only once. It is primarily used for starting the software, initializing and declaring variables and running functions that only have to run once (ex. Intro screen in a video game).
The void loop() is where everything else takes place. It basically runs every bit of code inside it over and over again (speed depends on the device – just imagine it’s ultra-fast!). It should pretty much follow the refresh rate of the screen and make the program do things accordingly.
Every block you place automatically goes into the void loop() function.
If you wish to put something in the void setup(), you have to drag the main block from Functions and place your blocks inside as you wish, but more on that a little bit later.

Elliptical blocks

Elliptical blocks represent variables. Whether we’re talking about integers, strings or other variable types (other than boolean), they can all be recognized by the same shape.

Also, larger blocks that have elliptical shape return either integer or float values.

random image



When ever you find circular “holes” inside some blocks, that is the place where variables can be inserted. It’s most commonly found in comparison or action blocks.

Triangular blocks

Boolean variables are represented by triangular blocks.

Both variables (true and false), as well as functions that return boolean values, have the same shape.

random image

Regardless of color, each of these blocks returns either true or false.
Triangular “holes” require boolean blocks to be inserted.

random image

Building blocks

Everything else is basically a building block. Those are functions that have no return value (they return null). Both elliptical and triangular blocks first have to be placed inside of the building blocks in order to act as part of the program.

They have a specific “puzzle” shape and can be stacked inside each other.

random image

The main building block is located inside the ‘Functions’ section.
It basically gives you two main building blocks sections.
Everything that is placed inside Arduino run first goes into void setup() and everything that is placed inside Arduino loop forever goes into a void loop().

random image

Inserting blocks

Now, this is the main part.

The whole point of blocks-like IDE is connecting blocks and placing them one inside another.

It is all done by simple drag-and-drop action.

Here is an example of a program that will set the variable Var to 1 and then increase that variable while it is smaller than 10.

At the end of the program, Var will be 10.

This is just a simple example and block-building will be further explained in the following chapters.

random image
友情链接:蘑菇视频入口 | 日本高清 | 在线午夜 | 番号网 | 五福影院 | mogu视频 | 永久地址 | 老王影院 | 蘑菇tv网页版 | 欧美午夜 | 蘑菇影视 | 最新av | 蘑菇视频ios | 酒色世界 | mogu | 蜜芽视频 | 蘑菇网页版入口 | 琵琶妞 | 五月丁香 | 秋霞网 | 摩天轮社区 | bt搜索 | 久久视频 | dna0126.com | gzdksw.com | 超碰视频 | 协和影院 | btupic.com | 玖玖资源站 | 六月婷婷 | 4008108885.com | 导航大全 | mogus.cc | 永久网站 | hebeijiaoyuwang.com | woqidz.com | 久久爱 | 天堂在线 | 久久久久久 | sanzhucare-zhpg.com | 色妞 | 资源导航 | 福利盒子 | 在线亚洲 | 色啪 | tsxhyq.com | 久久香蕉 | 无名网 | 蘑菇視頻 | dk99999.com | 蘑菇视频网站 | 老司机视频 | 蓝色导航 | 第一福利 | fltou.com | 精品免费 | 秋霞影院 | 午夜在线观看 | 蘑菇传媒 | 蘑菇传媒在线观看 | 小草社区 | 青娱 | 亚洲精品 | jxty00.com | 宅男影院 | 色婷婷 | mogutv | 四虎影视 | 小蓝视频 | lf397.com | zhuoyemall.com | 草莓视 | 福利精品 | 樱花视频 | 汤姆影院 | 迷妹网 | tissu-premier.com | 蘑菇短视频入口 | 龙物视频 | 亚洲网 | 扒哥黑料 | rencai98.com | 玖玖爱 | 蘑菇app | 看片神器 | zpzb2008.com | 伊人色 | 性知音 | 蘑菇在线观看网页版 | 屁屁影院 | 红桃视频 | p站视频 | 天天综合 | 综合影院 | 青草草 | 琳琅导航 | 青草青青 | 蘑菇网 | 青青伊人