Ks0397 keyestudio EASY plug Super Starter Kit for Arduino STEM EDU: Difference between revisions
Keyestudio (talk | contribs) (Created page with "==Product List== 1* EASY plug Control Board V2.0<br> 3* EASY plug Digital White LED Module<br> 1* EASY plug Thin-film Pressure Sensor<br> 1* EASY plug Analog Sound Sensor<br>...") |
Keyestudio (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
==Product | |||
1 | |||
3 | ==Kit Description== | ||
1 | The keyestudio EASY PLUG super starter kit is based on Mixly blocks coding, very easy to use and flexible. | ||
This kit includes everything you need to complete Mixly projects that will teach you how to control and read external sensors and displays, control matrix, learn Mixly Blocks programming, and much more. | |||
Although you have a few or even no electronics related knowledge, you can use this kit to realize your creative ideas as long as you want to. | |||
After using this kit you’ll have the know-how to start creating your own amazing experiments. Share your own creative works with your intimate family, friends or classmates. | |||
Let’s get started right now! | |||
==Kit List == | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | Product Name | |||
! align="center" scope="col" | Quantity | |||
! align="center" scope="col" | Picture | |||
|- | |||
| align="center" | 1 | |||
| align="center" | EASY plug Control Board V2.0 | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-1.png|500px|frameless|thumb]]<br> | |||
|- | |||
1* USB | | align="center" | 2 | ||
| align="center" | EASY plug White LED Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-2.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 3 | |||
| align="center" | EASY plug Blue LED Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-3.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 4 | |||
| align="center" | EASY plug Red LED Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-4.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 5 | |||
| align="center" | EASY plug thin-film pressure sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-5.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 6 | |||
| align="center" | EASY plug Analog Sound Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-6.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 7 | |||
| align="center" | EASY plug Water Level Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-7.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 8 | |||
| align="center" | EASY plug Potentiometer Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-8.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 9 | |||
| align="center" | EASY plug Analog Alcohol Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-9.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 10 | |||
| align="center" | EASY plug LM35 Temperature Sensor Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-10.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 11 | |||
| align="center" | EASY plug Digital Tilt Sensor Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-11.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 12 | |||
| align="center" | EASY plug Steam Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-12.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 13 | |||
| align="center" | EASY plug Hall Magnetic Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-13.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 14 | |||
| align="center" | EASY plug Crash Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-14.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 15 | |||
| align="center" | EASY plug Digital Push Button | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-15.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 16 | |||
| align="center" | EASY plug Reed Switch Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-16.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 17 | |||
| align="center" | EASY plug Line Tracking Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-17.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 18 | |||
| align="center" | EASY plug Photo Interrupter Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-18.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 19 | |||
| align="center" | EASY plug Single Relay Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-19.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 20 | |||
| align="center" | EASY plug ADXL345 Acceleration Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-20.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 21 | |||
| align="center" | EASY plug DHT11 Temperature and Humidity Sensor | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-21.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 22 | |||
| align="center" | EASY plug 8x8 LED Matrix | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-22.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 23 | |||
| align="center" | EASY plug 1602 LCD Module | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-22.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 24 | |||
| align="center" | EASY plug 4-digit LED display | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-24.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 25 | |||
| align="center" | 20mm blue RJ11 cable | |||
| align="center" | 5 | |||
| align="center" | <br>[[File:397-25.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 26 | |||
| align="center" | 30mm blue RJ11 cable | |||
| align="center" | 3 | |||
| align="center" | <br>[[File:397-26.png|500px|frameless|thumb]]<br> | |||
|- | |||
| align="center" | 27 | |||
| align="center" | USB cable | |||
| align="center" | 1 | |||
| align="center" | <br>[[File:397-27.png|200px|frameless|thumb]]<br> | |||
|- | |||
|} | |||
==Getting Started with Mixly== | |||
===Introduction for Mixly === | |||
[[File:Mixly-icon.png|900px|right|thumb| Mixly ]] | |||
Mixly is a free open-source graphical Arduino programming software, based on Google’s Blockly graphical programming framework, and developed by Mixly Team@ BNU. | |||
It is a free open-source graphical programming tool for creative electronic development; a complete support ecosystem for creative e-education; a stage for maker educators to realize their dreams. | |||
Although there is an Ardublock graphical programming software launched by Arduino official, Ardublock is not perfect enough, and many common functions cannot be realized. | |||
===Interface Functions of Mixly === | |||
==== System Functions ==== | |||
Look at the main interface of Mixly, it includes five parts, that is, Blocks selection, code edit, text code (hidden), system function and message prompt area. Shown below. | |||
<br>[[Image:3.1-1.png|800px|frameless]]<br> | |||
<br> | |||
'''Some common functions:''' <br> | |||
Through this interface, you can complete the code compile、upload、save and manage. It support four remove methods: drag it left out code window, or drag to Recycle Bin, delete key, or right-click to delete block. It supports four languages: English、Español (Spanish)、中文简体(Chinese Simplified)、中文繁体(Chinese Traditional). | |||
<br>[[Image:3.1-2.png|800px|frameless]]<br> | |||
<br> | |||
====In/Out Block==== | |||
[[Image:3.2-1.png|800px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.2-2.png|400px|frameless]]<br> | |||
| align="center" | Returns HIGH or LOW voltage | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.2-3.png|400px|frameless]]<br> | |||
| align="center" | Write digital value to a specific Port.<br> | |||
Digital Output: set the HIGH or LOW output for IO pins | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.2-4.png|400px|frameless]]<br> | |||
| align="center" | Returns a digital value of a specific Port.<br> | |||
Digital IO Read Pin, generally used to read the HIGH or LOW level detected by Digital sensor | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.2-5.png|400px|frameless]]<br> | |||
| align="center" | Write analog value between 2 and 255 to a specific Port.<br> | |||
Analog Output: set the Analog value output by Analog IO pins (0~255). | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.2-6.png|400px|frameless]]<br> | |||
| align="center" | Returns value between 0 and 1023 of a specific Port. <br> | |||
Analog IO Read Pin, generally used to read the Analog value detected by Analog sensor. | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.2-7.png|400px|frameless]]<br> | |||
| align="center" | External Interrupts function, with three trigger interrupt modes RISING, FALLING, CHANGE. | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.2-8.png|400px|frameless]]<br> | |||
| align="center" | Detachs interrupt to a specific Port.<br> | |||
Turn off the given interrupt function. | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.2-9.png|400px|frameless]]<br> | |||
| align="center" | Set the IO pins as Output or Input state | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.2-10.png|400px|frameless]]<br> | |||
| align="center" | Read the continuous time of HIGH or LOW pulse from IO pins.( generally used for ultrasonic ranging) | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.2-11.png|400px|frameless]]<br> | |||
| align="center" | Read a pulse (either HIGH or LOW) on a pin within a time set in timeout. | |||
|- | |||
| align="center" | 11 | |||
| align="center" | <br>[[Image:3.2-12.png|400px|frameless]]<br> | |||
| align="center" | Set the ShiftOut data pin, clock pin. Output the data needed from the bitOrder MSBFIRST or LSBFIRST (Most Significant Bit First, or, Least Significant Bit First).<br> | |||
Generally used for controlling the 74HC595 CHIP. | |||
|- | |||
| align="center" | 12 | |||
| align="center" | <br>[[Image:3.2-13.png|300px|frameless]]<br> | |||
| align="center" | This is the function interface under Normal mode. If select Advanced mode, the functions will be more. | |||
|- | |||
|} | |||
<br> | |||
'''For example:'''<br> | |||
Connect your Arduino Uno board, then follow the steps below to light the Pin13 led on Arduino UNO. | |||
<br>[[Image:3.2 led D13.PNG|800px|frameless]]<br> | |||
<br> | |||
====Control Block==== | |||
[[Image:Control.PNG|800px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.3-1.png|600px|frameless]]<br> | |||
| align="center" | Initialization (run only once) | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.3-2.png|600px|frameless]]<br> | |||
| align="center" | End the program, means the program will stop running when use this block. | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.3-3.png|400px|frameless]]<br> | |||
| align="center" | Delay function, click to select '''ms''' or '''us''' <br> | |||
(pause the program for the amount of time (in milliseconds) specified as parameter. There are 1000 milliseconds in a second.) | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.3-4.png|600px|frameless]]<br> | |||
| align="center" | '''if_do''' function (first evaluate a value be true or false, if a value is true, then do some statement. <br> | |||
You can click the blue gear icon to select the '''else if''' block or '''else''' block.) | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.3-5.png|600px|frameless]]<br> | |||
| align="center" | '''switch''' function. You can click the blue gear icon to select the '''case''' block or '''default''' block. (used to evaluate several programs then execute the corresponding function matched with program.) | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.3-6.png|600px|frameless]]<br> | |||
| align="center" | Equal to [https://www.arduino.cc/reference/en/language/structure/control-structure/for/ '''for''' statement]. | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.3-7.png|600px|frameless]]<br> | |||
| align="center" | A '''while''' loop statement. | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.3-8.png|600px|frameless]]<br> | |||
| align="center" | '''break''' function, used to exit from the containing loop. | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.3-9.png|600px|frameless]]<br> | |||
| align="center" | '''millis()''' function, returns the system running time since the program started. | |||
(The unit can be '''ms''' (milliseconds) or '''μs'''(microsecond)). | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.3-10.png|600px|frameless]]<br> | |||
| align="center" | Timer interrupt function, that is, set a trigger interrupt for the amount of time (in milliseconds) specified as parameter. | |||
|- | |||
| align="center" | 11 | |||
| align="center" | <br>[[Image:3.3-11.png|400px|frameless]]<br> | |||
| align="center" | Timer interrupt start block | |||
|- | |||
| align="center" | 12 | |||
| align="center" | <br>[[Image:3.3-12.png|400px|frameless]]<br> | |||
| align="center" | Timer interrupt stop block | |||
|- | |||
|} | |||
<br> | |||
'''For example:'''<br> | |||
Compile and upload the program below to your Arduino board, you should see Pin13 LED on Arduino UNO continue to flash.(with an interval of 1s, equal to 1000ms) | |||
<br>[[Image:3.3 flash.PNG|800px|frameless]]<br> | |||
<br> | |||
==== Math Block==== | |||
[[Image:3.4.png|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.4-1.png|300px|frameless]]<br> | |||
| align="center" | A number | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.4-2.png|300px|frameless]]<br> | |||
| align="center" | Click to select the Arithmetic Operators: <br> | |||
[https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/addition/ '''+(addition)''']; | |||
[https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/subtraction/ '''-(subtraction)''']; | |||
[https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/multiplication/ '''x (Multiplication)''']; [https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/division/ '''÷(division)''']; [https://www.arduino.cc/reference/en/language/structure/arithmetic-operators/remainder/ ''' %(remainder)''']; | |||
[https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitwisexor/ ''' ^(bitwise xor)'''] <br> | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.4-3.png|300px|frameless]]<br> | |||
| align="center" | Click to select the [https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitwiseand/ '''& (bitwise end)''']; [https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitwiseor/ '''l (bitwise or)''']; [https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitshiftleft/ '''<< (bitshift left)''']; [https://www.arduino.cc/reference/en/language/structure/bitwise-operators/bitshiftright/ '''>> (bitshift right)'''] | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.4-4.png|200px|frameless]]<br> | |||
| align="center" | Click to select the [https://www.arduino.cc/reference/en/language/functions/trigonometry/sin/ '''sin''']; [https://www.arduino.cc/reference/en/language/functions/trigonometry/cos/ '''cos''']; '''tan; asin; acos; atan; ln; log10; e^; 10^;''' [https://www.arduino.cc/reference/en/language/structure/compound-operators/increment/ '''++ (increment)'''] ; | |||
[https://www.arduino.cc/reference/en/language/structure/compound-operators/decrement/ '''-- (decrement)'''] | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.4-5.png|200px|frameless]]<br> | |||
| align="center" | Click to select the '''Round; Ceil; Floor; abs; sq; sqrt''' <br> | |||
'''Round:''' Returns the integer part a number using around.<br> | |||
'''Ceil:''' Returns the integer part a number using ceil.<br> | |||
'''Floor:''' Returns the integer part a number using floor.<br> | |||
'''abs:''' Return the absolute value of a number.<br> | |||
'''sq:''' Return the square of a number.<br> | |||
'''sqrt:''' Return the square root of a number. | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.4-6.png|400px|frameless]]<br> | |||
| align="center" | If select the '''max''', returns the larger number; <br> | |||
if select the '''min''', returns the smaller number. | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.4-7.png|400px|frameless]]<br> | |||
| align="center" | Initialize the random seed | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.4-8.png|400px|frameless]]<br> | |||
| align="center" | Return a random integer between the two specified limits, inclusive. | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.4-9.png|400px|frameless]]<br> | |||
| align="center" | Constrain a number to be between the specified limits (inclusive). <br> | |||
(generally used to constrain an analog value read from sensor) | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.4-10.png|400px|frameless]]<br> | |||
| align="center" | Map a number from the first interval to the second interval. <br> | |||
(For instance, potentiometer-controlled servo, map the range of potentiometer (0, 1023) to the angle of servo (0, 180)). | |||
|- | |||
|} | |||
<br> | |||
====Text Block==== | |||
[[Image:3.5.png|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.5-1.png|800px|frameless]]<br> | |||
| align="center" | character string: a letter, word, or line of text. | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.5-2.png|800px|frameless]]<br> | |||
| align="center" | A character | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.5-3.png|800px|frameless]]<br> | |||
| align="center" | Creates a piece of text by joining together two piece of text. <br> | |||
( Here Hello join Mixly equals HelloMixly) | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.5-4.png|800px|frameless]]<br> | |||
| align="center" | Converts a string into an integer or an float. | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.5-5.png|800px|frameless]]<br> | |||
| align="center" | Returns the char corresponding to an ASCII code <br> | |||
(Decimal number 97 corresponding to a) | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.5-6.png|800px|frameless]]<br> | |||
| align="center" | Returns the ASCII code corresponding to a char. | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.5-7.png|800px|frameless]]<br> | |||
| align="center" | Converts a number into a string. | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.5-8.png|800px|frameless]]<br> | |||
| align="center" | Calculates the length of a string | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.5-9.png|800px|frameless]]<br> | |||
| align="center" | Output the char of a string (the char at 0 of hello is h) | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.5-10.png|800px|frameless]]<br> | |||
| align="center" |The first string equals or startsWith or endsWith the second string, returns 1, otherwise returns 0.<br> | |||
(if equals, both strings are abc, returns 1.) | |||
|- | |||
| align="center" | 11 | |||
| align="center" | <br>[[Image:3.5-11.png|800px|frameless]]<br> | |||
| align="center" |Returns a decimal value of the first string subtracts the second string. | |||
|- | |||
|} | |||
<br> | |||
====List Block==== | |||
[[Image:3.6.png|800px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.6-1.png|300px|frameless]]<br> | |||
| align="center" | Create a list with any number of items | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.6-2.png|800px|frameless]]<br> | |||
| align="center" | Creats a list from a text. (int mylist [ ]={0,0,0};) | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.6-3.png|400px|frameless]]<br> | |||
| align="center" | Creats a list from a text. (int mylist [ ]={0,0,0};) | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.6-4.png|700px|frameless]]<br> | |||
| align="center" | Returns the value of at the specified position in a list. | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.6-5.png|800px|frameless]]<br> | |||
| align="center" | Sets the value of at the specified position in a list.<br> | |||
Set the first item in mylist to another item. | |||
|- | |||
|} | |||
<br> | |||
====Logic Block==== | |||
[[Image:3.7.png|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.7-1.png|400px|frameless]]<br> | |||
| align="center" | '''logic comparision'''<br> | |||
'''=:''' Return true if both inputs equal each other.<br> | |||
'''≠:''' Return true if both inputs are not equal to each other.<br> | |||
'''<:''' Return true if the first input is smaller than the second input.<br> | |||
'''≤ :''' Return true if the first input is smaller than or equal to the second input.<br> | |||
'''>:''' Return true if the first input is greater than the second input. <br> | |||
'''≥ :''' Return true if the first input is greater than or equal to the second input. | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.7-2.png|400px|frameless]]<br> | |||
| align="center" | '''and:'''Return true if both inputs are true; | |||
'''or:''' Return true if at least one of the inputs is true | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.7-3.png|600px|frameless]]<br> | |||
| align="center" | Returns true if the input is false. Returns false if the input is true. | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.7-4.png|600px|frameless]]<br> | |||
| align="center" | Returns either true or false. | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.7-5.png|600px|frameless]]<br> | |||
| align="center" | Returns null | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.7-6.png|600px|frameless]]<br> | |||
| align="center" | If the first number is true, the second number is returned, otherwise the third number. | |||
|- | |||
|} | |||
<br> | |||
====Variable Block==== | |||
[[Image:3.8.png|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.8-1.png|800px|frameless]]<br> | |||
| align="center" | Declare and initialize a variable.<br> | |||
Click to select [https://www.arduino.cc/reference/en/language/variables/data-types/int/ '''int'''], [https://www.arduino.cc/reference/en/language/variables/data-types/long/ '''long'''],[https://www.arduino.cc/reference/en/language/variables/data-types/float/ '''float'''], [https://www.arduino.cc/reference/en/language/variables/data-types/boolean/ '''boolean'''], '''[https://www.arduino.cc/reference/en/language/variables/data-types/byte/ byte'''],[https://www.arduino.cc/reference/en/language/variables/data-types/char/ '''char'''], [https://www.arduino.cc/reference/en/language/variables/data-types/string/ '''string'''] | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.8-2.png|600px|frameless]]<br> | |||
| align="center" | Define the data types | |||
|- | |||
|} | |||
<br> | |||
'''For example: LED breath'''<br> | |||
You need an Arduino Uno and one LED module. Connect the control pin of LED module to Pin 3 of Uno board (or other pins with “~”,that is, those pins can output PWM signal). LED will gradually light then gradually dim, repeatedly. | |||
<br>[[Image:3.8 LED breath.PNG|800px|frameless]]<br> | |||
<br> | |||
====SerialPort Block==== | |||
[[Image:3.9.png|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.9-1.png|600px|frameless]]<br> | |||
| align="center" | Set the serial buad rate to 9600 | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.9-2.png|400px|frameless]]<br> | |||
| align="center" | Write the specified number, text or other value. | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.9-3.png|400px|frameless]]<br> | |||
| align="center" | Print the specified number, text or other value on monitor. | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.9-4.png|400px|frameless]]<br> | |||
| align="center" | Print the specified number, text or other value on newline of monitor. | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.9-5.png|600px|frameless]]<br> | |||
| align="center" | Print the specified number in hexademical format on newline of monitor. | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.9-6.png|600px|frameless]]<br> | |||
| align="center" | If the serial port is available, it returns true, otherwise returns false.<br> | |||
(generally used in Bluetooth communication) | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.9-7.png|600px|frameless]]<br> | |||
| align="center" | Returns a string in serial port | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.9-8.png|600px|frameless]]<br> | |||
| align="center" | A string read from serial port to a string variable, pause until read the specified character. | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.9-9.png|600px|frameless]]<br> | |||
| align="center" | Read the serial data by byte (generally used to read the value sent from Bluetooth) (delete the data has been read) | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.9-10.png|600px|frameless]]<br> | |||
| align="center" | Wait for the output data completed | |||
|- | |||
| align="center" | 11 | |||
| align="center" | <br>[[Image:3.9-11.png|600px|frameless]]<br> | |||
| align="center" | Set the software serial port <br> | |||
(call this function if need to use several serial ports) | |||
|- | |||
| align="center" | 12 | |||
| align="center" | <br>[[Image:3.9-12.png|600px|frameless]]<br> | |||
| align="center" | Event function trigger by serial port data, that is, serial port is ready to call this function.<br> | |||
(equal to an interrupt function) | |||
|- | |||
|} | |||
<br> | |||
'''For example: serial communication'''<br> | |||
Done uploading the code, open the Arduino monitor, then enter a “hello” on the top bar, and click Send, it will print out “hello,world”. | |||
<br>[[Image:3.9 Serial port -1.PNG|800px|frameless]]<br> | |||
<br>[[Image:3.9-13.png|800px|frameless]]<br> | |||
<br> | |||
====Communicate Block==== | |||
[[Image:Communicate.PNG|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.10-1.png|500px|frameless]]<br> | |||
| align="center" | Do something when receiving infrared signals. | |||
<br>[[Image:3.10-1-1.png|500px|frameless]]<br> | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.10-2.png|500px|frameless]]<br> | |||
| align="center" | Sends infrared signals of the specified types.<br> | |||
IR transmitter sends the data, here use the libraries, only PIN3 port. | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.10-3.png|800px|frameless]]<br> | |||
| align="center" | Enable IR decoding | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.10-4.png|800px|frameless]]<br> | |||
| align="center" | Print the Infrared signal in RAW types when receiving it. | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.10-5.png|800px|frameless]]<br> | |||
| align="center" | Sends RAW infrared signals (set the pin number, list, length of list and IR frequency) | |||
|- | |||
|} | |||
<br> | |||
'''For example:''' <br> | |||
You need an Arduino Uno board, an IR receiver module and an IR remote control.<br> | |||
Connect the signal pin of IR receiver to Digital pin 3 of Uno board, then upload the code and open the monitor. If send a signal to an IR receiver module using an IR remote control, you should see the monitor show the corresponding signal data. | |||
<br>[[Image:3.10 ir.PNG|900px|frameless]]<br> | |||
<br> | |||
====Sensor Block==== | |||
[[Image:Sensor.PNG|1000px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.11-1.png|800px|frameless]]<br> | |||
| align="center" | Set the Trig and Echo pin of ultrasonic sensor.<br> | |||
Returns the distance of ultrasonic sensor measured. ('''unit:''' cm) | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.11-2.png|800px|frameless]]<br> | |||
| align="center" | Set the control pin of DHT11 temperature and humidity sensor. <br> | |||
Returns the temperature or humidity of DHT 11 sensor measured. | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.11-3.png|800px|frameless]]<br> | |||
| align="center" | Set the control pin of DHT11 temperature and humidity sensor. <br> | |||
Returns the temperature or humidity of DHT 11 sensor measured. | |||
|- | |||
|} | |||
<br> | |||
'''For example: ultrasonic ranging'''<br> | |||
Connect the Trig pin of ultrasonic sensor to Digital 1 of Uno, Echo pin to D2, then upload the code and open the monitor, you should see the distance value, updating once per 100ms. | |||
<br>[[Image:3.11-4.png|800px|frameless]]<br> | |||
<br> | |||
====Actuator Block==== | |||
[[Image:Actuator.PNG|1000px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.12-1.png|800px|frameless]]<br> | |||
| align="center" | Sets the servo pin;<br> | |||
Moves between 0-180 degree;<br> | |||
Delay time for servo to rotate. | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.12-2.png|800px|frameless]]<br> | |||
| align="center" | Returns that degree with the last servo move.<br> | |||
Read the degree of servo connected to IO pin set | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.12-3.png|800px|frameless]]<br> | |||
| align="center" | Set the pin and specified frequency for buzzer to play sound. | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.12-4.png|800px|frameless]]<br> | |||
| align="center" | Stop playing sound | |||
|- | |||
|} | |||
<br> | |||
'''For example:''' <br> | |||
Connect the signal end of servo to Digital 0 of Uno, then upload the code below, servo will rotate 90 degrees. <br> | |||
'''Note:''' Delay 100ms is the time required for servo to move. | |||
<br>[[Image:3.12-5.png|800px|frameless]]<br> | |||
<br> | |||
====Monitor Block==== | |||
[[Image:Monitor.PNG|900px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.13-1.png|800px|frameless]]<br> | |||
| align="center" | Set the IIC LCD1602 address | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.13-2.png|800px|frameless]]<br> | |||
| align="center" | Input the value on LCD line 1 and line 2 from left to right. | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.13-3.png|800px|frameless]]<br> | |||
| align="center" | Set the row and column of LCD to print the char | |||
|- | |||
| align="center" | 4 | |||
| align="center" | <br>[[Image:3.13-4.png|500px|frameless]]<br> | |||
| align="center" | Clear the LCD screen | |||
|- | |||
| align="center" | 5 | |||
| align="center" | <br>[[Image:3.13-5.png|800px|frameless]]<br> | |||
| align="center" | Set the control pin and the number of RGB light. | |||
|- | |||
| align="center" | 6 | |||
| align="center" | <br>[[Image:3.13-6.png|800px|frameless]]<br> | |||
| align="center" | Set the RGB light pin, light number and brightness | |||
|- | |||
| align="center" | 7 | |||
| align="center" | <br>[[Image:3.13-7.png|800px|frameless]]<br> | |||
| align="center" | Set the control pin, light number and color. (click to select the color) | |||
|- | |||
| align="center" | 8 | |||
| align="center" | <br>[[Image:3.13-8.png|800px|frameless]]<br> | |||
| align="center" | Clear the data, namely turn off digital display | |||
|- | |||
| align="center" | 9 | |||
| align="center" | <br>[[Image:3.13-9.png|800px|frameless]]<br> | |||
| align="center" | Four-digit display, displaying abcd. | |||
|- | |||
| align="center" | 10 | |||
| align="center" | <br>[[Image:3.13-10.png|800px|frameless]]<br> | |||
| align="center" | Turn on or off the digitdisplay <br> | |||
(here turn on the first digitdisplay) | |||
|- | |||
|} | |||
<br> | |||
'''For example: serial communication'''<br> | |||
Separately connect the SDA (A4) and SCL (A5) of Arduino Uno to SDA and SCL pins of IIC LCD1602, then set the address of your LCD1602 screen, the LCD address we used here is 0x27. Then upload the code, LCD screen has two lines, you should see the line 1 print HELLO, and line 2 print 123456789.<br> | |||
<br>[[Image:3.13 LCD16002.PNG|800px|frameless]]<br> | |||
<br> | |||
====Functions Block==== | |||
[[Image:Function.PNG|800px|frameless]]<br> | |||
{| width="80%" cellspacing="0" border="1" | |||
|- | |||
! align="center" scope="col" | No. | |||
! align="center" scope="col" | BLOCK ICON | |||
! align="center" scope="col" | DEFINITION | |||
|- | |||
| align="center" | 1 | |||
| align="center" | <br>[[Image:3.14-1.png|500px|frameless]]<br> | |||
| align="center" | Creates a function with no output.<br> | |||
Click the blue icon to set the procedure parameter.(no return value) | |||
|- | |||
| align="center" | 2 | |||
| align="center" | <br>[[Image:3.14-2.png|500px|frameless]]<br> | |||
| align="center" | Creates a function with an output.<br> | |||
Click the blue icon to set the procedure parameter.<br> | |||
(with return value and can set the data types) | |||
|- | |||
| align="center" | 3 | |||
| align="center" | <br>[[Image:3.14-3.png|500px|frameless]]<br> | |||
| align="center" | If a value is true, then return a second value. | |||
|- | |||
|} | |||
<br> | |||
'''For example: ultrasonic ranging'''<br> | |||
Below is an example code for line tracking car. We use three tracking modules (left to D6, middle to D7, right to D8). of course you need a tracking car to test it. First edit the forward, backward, turn left, turn right and stop into functions block. Then compile and upload the code below. | |||
<br>[[Image:图片1-mixly 3.14.png|800px|frameless]]<br> | |||
<br>[[Image:3.14-4.png|800px|frameless]]<br> | |||
<br> | |||
==Installing Arduino Software== | |||
When you get the control board, first you should install the Arduino software and driver. We usually use the software Arduino 1.5.6 version. | |||
You can download it from the link below: | |||
https://www.arduino.cc/en/Main/OldSoftwareReleases#1.5.x | |||
Or you can browse the ARDUINO website to download the latest version from this link, https://www.arduino.cc, pop up the following interface. | |||
<br>[[Image:KS0313-1.png|600px|frameless]]<br> | |||
Then click the '''SOFTWARE''' on the browse bar, you will have two options ONLINE TOOLS and DOWNLOADS. | |||
<br>[[Image:KS0313-2.png|600px|frameless]]<br> | |||
Click '''DOWNLOADS''', it will appear the latest software version of ARDUINO 1.8.5 shown as below. | |||
<br>[[Image:KS0313-3.png|600px|frameless]]<br> | |||
In this software page, on the right side you can see the version of development software for different operating systems. ARDUINO has a powerful compatibility. You should download the software that is compatible with the operating system of your computer.<br> | |||
We will take '''WINDOWS system''' as an example here. There are also two options under Windows system, one is installed version, the other is non-installed version. | |||
For simple installed version, first click '''Windows Installer''', you will get the following page.<br> | |||
<br>[[Image:KS0313-4.png|600px|frameless]]<br> | |||
<br>[[Image:KS0313-5.png|600px|frameless]]<br> | |||
This way you just need to click JUST DOWNLOAD, then click the downloaded file to install it. <br> | |||
For non-installed version, first click Windows ZIP file, you will also get the pop-up interface as the above figure.<br> | |||
Click JUST DOWNLOAD, and when the ZIP file is downloaded well to your computer, you can directly unzip the file and click the icon of ARDUINO software to start it. <br> | |||
<br> | |||
====Installing Arduino (Windows)==== | |||
Install Arduino with the exe. Installation package downloaded well. | |||
<br>[[File:Arduino Setup 1.jpg|800px|frameless|thumb]]<br> | |||
Click“I Agree”to see the following interface. | |||
<br>[[File:Arduino Setup 2.jpg|800px|frameless|thumb]]<br> | |||
Click “Next”. Pop up the interface below. | |||
<br>[[File:Arduino Setup 3.jpg|800px|frameless|thumb]]<br> | |||
You can press Browse… to choose an installation path or directly type in the directory you want.<br> | |||
Then click “Install” to initiate installation. | |||
<br>[[File:Arduino Setup 4.jpg|800px|frameless|thumb]]<br> | |||
Wait for the installing process, if appear the interface of Window Security, just continue to click Install to finish the installation. | |||
<br>[[File:Arduino1.5.6- setup 5.png|800px|frameless|thumb]]<br> | |||
<br> | |||
====Installing Driver==== | |||
Next, we will introduce the driver installation of UNO R3 development board. The driver installation may have slight differences in different computer systems. So in the following let’s move on to the driver installation in the WIN 7 system. <br> | |||
The Arduino folder contains both the Arduino program itself and the drivers that allow the Arduino to be connected to your computer by a USB cable. Before we launch the Arduino software, you are going to install the USB drivers.<br> | |||
<br>[[Image:KS0001-1.jpg|600px|frameless]]<br> | |||
Plug one end of your USB cable into the Arduino and the other into a USB socket on your computer. | |||
When you connect UNO board to your computer at the first time, right click the icon of your “Computer” —>for “Properties”—> click the “Device manager”, under “Other Devices”, you should see an icon for “Unknown device” with a little yellow warning triangle next to it. This is your Arduino.<br> | |||
<br>[[Image:Driver 1.png|600px|frameless]]<br> | |||
Then right-click on the device and select the top menu option (Update Driver Software...) shown as the figure below.. | |||
<br>[[Image:Driver 2.png|600px|frameless]]<br> | |||
It will then be prompted to either “Search Automatically for updated driversoftware” or “Browse my computer for driver software”. Shown as below. In this page, select “Browse my computer for driver software”. | |||
<br>[[Image:Driver 3.png|600px|frameless]]<br> | |||
After that, select the option to browseand navigate to the “drivers” folder of Arduino installation. | |||
<br>[[Image:KS0286-4.png|800px|frameless]]<br> | |||
Click “Next” and you may get a security warning, if so, allow the software to be installed. Shown as below. | |||
<br>[[Image:Driver 5.png|600px|frameless]]<br> | |||
Once the software has been installed, you will get a confirmation message. Installation completed, click “Close”. | |||
<br>[[Image:Driver 6.png|600px|frameless]]<br> | |||
Up to now, the driver is installed well. Then you can right click “Computer” —>“Properties”—>“Device manager”, you should see the device as the figure shown below. | |||
<br>[[Image:Driver 7.png|600px|frameless]]<br> | |||
<br> | |||
==Let’s Get Started With Your Projects== | |||
===Project 1: Hello World=== | |||
'''Overview''' | |||
This project is very simple. You can use only a main board and a USB cable to display the “Hello World!”. It is a communication experiment between the EASY Plug control board and PC. This is an entry experiment for you to enter the Arduino programming world. | |||
Note that need to use a serial communication software, Arduino IDE. | |||
In the above part, you can check the detailed use of Arduino IDE. | |||
'''Component Required:''' | |||
* EASY plug control board*1 | |||
* USB cable*1 | |||
'''Component Introduction:''' | |||
<br>[[File:397-1.png|500px|frameless|thumb]]<br> | |||
The processor used in keyestudio EASY plug control board V2.0 is ATmega328. It has 5 single Digital ports labeled D5 to D9 (of which 3 can be used as PWM outputs), 1 dual-digital interface (D3-D4), 4 analog inputs (A0-A3), a Joystick socket (D2-A6-A7), a SPI, a serial port and an IIC communication interface. Also with a USB connection, a power jack, two ICSP headers and a reset button. It breaks out the IO ports with RJ11 6P6C plug. | |||
'''Connect It Up''' | |||
Connect the control board to your computer via a micro USB cable. | |||
'''Upload the Code''' | |||
Below is an example code for displaying the Hello World! | |||
<pre> | |||
int val; | |||
int ledpin=13; | |||
void setup() | |||
{ | |||
Serial.begin(9600); | |||
pinMode(ledpin,OUTPUT); | |||
} | |||
void loop() | |||
{ | |||
val=Serial.read(); | |||
if(val=='R') | |||
{ | |||
digitalWrite(ledpin,HIGH); | |||
delay(500); | |||
digitalWrite(ledpin,LOW); | |||
delay(500); | |||
Serial.println("Hello World!"); | |||
} | |||
} | |||
</pre> | |||
'''Select the Arduino Board''' | |||
Open the Arduino IDE, you’ll need to click the “Tools”, then select the Board that corresponds to your Arduino. | |||
<br>[[File:397-1.png|500px|frameless|thumb]]<br> | |||
'''Select your serial port''' | |||
Select the serial device of the Arduino board from the Tools | Serial Port menu. | |||
<span style="color: red">'''Note: ''' to avoid errors, the COM Port should keep the same as the Ports shown on Device Manager. |
Revision as of 11:42, 10 January 2019
Kit Description
The keyestudio EASY PLUG super starter kit is based on Mixly blocks coding, very easy to use and flexible. This kit includes everything you need to complete Mixly projects that will teach you how to control and read external sensors and displays, control matrix, learn Mixly Blocks programming, and much more. Although you have a few or even no electronics related knowledge, you can use this kit to realize your creative ideas as long as you want to. After using this kit you’ll have the know-how to start creating your own amazing experiments. Share your own creative works with your intimate family, friends or classmates. Let’s get started right now!
Kit List
Getting Started with Mixly
Introduction for Mixly
Mixly is a free open-source graphical Arduino programming software, based on Google’s Blockly graphical programming framework, and developed by Mixly Team@ BNU. It is a free open-source graphical programming tool for creative electronic development; a complete support ecosystem for creative e-education; a stage for maker educators to realize their dreams. Although there is an Ardublock graphical programming software launched by Arduino official, Ardublock is not perfect enough, and many common functions cannot be realized.
Interface Functions of Mixly
System Functions
Look at the main interface of Mixly, it includes five parts, that is, Blocks selection, code edit, text code (hidden), system function and message prompt area. Shown below.
Some common functions:
Through this interface, you can complete the code compile、upload、save and manage. It support four remove methods: drag it left out code window, or drag to Recycle Bin, delete key, or right-click to delete block. It supports four languages: English、Español (Spanish)、中文简体(Chinese Simplified)、中文繁体(Chinese Traditional).
In/Out Block
For example:
Connect your Arduino Uno board, then follow the steps below to light the Pin13 led on Arduino UNO.
Control Block
No. | BLOCK ICON | DEFINITION |
---|---|---|
1 | Initialization (run only once) | |
2 | End the program, means the program will stop running when use this block. | |
3 | Delay function, click to select ms or us (pause the program for the amount of time (in milliseconds) specified as parameter. There are 1000 milliseconds in a second.) | |
4 | if_do function (first evaluate a value be true or false, if a value is true, then do some statement. You can click the blue gear icon to select the else if block or else block.) | |
5 | switch function. You can click the blue gear icon to select the case block or default block. (used to evaluate several programs then execute the corresponding function matched with program.) | |
6 | Equal to for statement. | |
7 | A while loop statement. | |
8 | break function, used to exit from the containing loop. | |
9 | millis() function, returns the system running time since the program started.
(The unit can be ms (milliseconds) or μs(microsecond)). | |
10 | Timer interrupt function, that is, set a trigger interrupt for the amount of time (in milliseconds) specified as parameter. | |
11 | Timer interrupt start block | |
12 | Timer interrupt stop block |
For example:
Compile and upload the program below to your Arduino board, you should see Pin13 LED on Arduino UNO continue to flash.(with an interval of 1s, equal to 1000ms)
Math Block
No. | BLOCK ICON | DEFINITION |
---|---|---|
1 | A number | |
2 | Click to select the Arithmetic Operators: +(addition);
-(subtraction);
x (Multiplication); ÷(division); %(remainder);
^(bitwise xor) | |
3 | Click to select the & (bitwise end); l (bitwise or); << (bitshift left); >> (bitshift right) | |
4 | Click to select the sin; cos; tan; asin; acos; atan; ln; log10; e^; 10^; ++ (increment) ; | |
5 | Click to select the Round; Ceil; Floor; abs; sq; sqrt Round: Returns the integer part a number using around. | |
6 | If select the max, returns the larger number; if select the min, returns the smaller number. | |
7 | Initialize the random seed | |
8 | Return a random integer between the two specified limits, inclusive. | |
9 | Constrain a number to be between the specified limits (inclusive). (generally used to constrain an analog value read from sensor) | |
10 | Map a number from the first interval to the second interval. (For instance, potentiometer-controlled servo, map the range of potentiometer (0, 1023) to the angle of servo (0, 180)). |
Text Block
List Block
Logic Block
Variable Block
No. | BLOCK ICON | DEFINITION |
---|---|---|
1 | Declare and initialize a variable. | |
2 | Define the data types |
For example: LED breath
You need an Arduino Uno and one LED module. Connect the control pin of LED module to Pin 3 of Uno board (or other pins with “~”,that is, those pins can output PWM signal). LED will gradually light then gradually dim, repeatedly.
SerialPort Block
For example: serial communication
Done uploading the code, open the Arduino monitor, then enter a “hello” on the top bar, and click Send, it will print out “hello,world”.
Communicate Block
For example:
You need an Arduino Uno board, an IR receiver module and an IR remote control.
Connect the signal pin of IR receiver to Digital pin 3 of Uno board, then upload the code and open the monitor. If send a signal to an IR receiver module using an IR remote control, you should see the monitor show the corresponding signal data.
Sensor Block
For example: ultrasonic ranging
Connect the Trig pin of ultrasonic sensor to Digital 1 of Uno, Echo pin to D2, then upload the code and open the monitor, you should see the distance value, updating once per 100ms.
Actuator Block
For example:
Connect the signal end of servo to Digital 0 of Uno, then upload the code below, servo will rotate 90 degrees.
Note: Delay 100ms is the time required for servo to move.
Monitor Block
For example: serial communication
Separately connect the SDA (A4) and SCL (A5) of Arduino Uno to SDA and SCL pins of IIC LCD1602, then set the address of your LCD1602 screen, the LCD address we used here is 0x27. Then upload the code, LCD screen has two lines, you should see the line 1 print HELLO, and line 2 print 123456789.
Functions Block
For example: ultrasonic ranging
Below is an example code for line tracking car. We use three tracking modules (left to D6, middle to D7, right to D8). of course you need a tracking car to test it. First edit the forward, backward, turn left, turn right and stop into functions block. Then compile and upload the code below.
Installing Arduino Software
When you get the control board, first you should install the Arduino software and driver. We usually use the software Arduino 1.5.6 version.
You can download it from the link below:
https://www.arduino.cc/en/Main/OldSoftwareReleases#1.5.x
Or you can browse the ARDUINO website to download the latest version from this link, https://www.arduino.cc, pop up the following interface.
Then click the SOFTWARE on the browse bar, you will have two options ONLINE TOOLS and DOWNLOADS.
Click DOWNLOADS, it will appear the latest software version of ARDUINO 1.8.5 shown as below.
In this software page, on the right side you can see the version of development software for different operating systems. ARDUINO has a powerful compatibility. You should download the software that is compatible with the operating system of your computer.
We will take WINDOWS system as an example here. There are also two options under Windows system, one is installed version, the other is non-installed version.
For simple installed version, first click Windows Installer, you will get the following page.
This way you just need to click JUST DOWNLOAD, then click the downloaded file to install it.
For non-installed version, first click Windows ZIP file, you will also get the pop-up interface as the above figure.
Click JUST DOWNLOAD, and when the ZIP file is downloaded well to your computer, you can directly unzip the file and click the icon of ARDUINO software to start it.
Installing Arduino (Windows)
Install Arduino with the exe. Installation package downloaded well.
Click“I Agree”to see the following interface.
Click “Next”. Pop up the interface below.
You can press Browse… to choose an installation path or directly type in the directory you want.
Then click “Install” to initiate installation.
Wait for the installing process, if appear the interface of Window Security, just continue to click Install to finish the installation.
Installing Driver
Next, we will introduce the driver installation of UNO R3 development board. The driver installation may have slight differences in different computer systems. So in the following let’s move on to the driver installation in the WIN 7 system.
The Arduino folder contains both the Arduino program itself and the drivers that allow the Arduino to be connected to your computer by a USB cable. Before we launch the Arduino software, you are going to install the USB drivers.
Plug one end of your USB cable into the Arduino and the other into a USB socket on your computer.
When you connect UNO board to your computer at the first time, right click the icon of your “Computer” —>for “Properties”—> click the “Device manager”, under “Other Devices”, you should see an icon for “Unknown device” with a little yellow warning triangle next to it. This is your Arduino.
Then right-click on the device and select the top menu option (Update Driver Software...) shown as the figure below..
It will then be prompted to either “Search Automatically for updated driversoftware” or “Browse my computer for driver software”. Shown as below. In this page, select “Browse my computer for driver software”.
After that, select the option to browseand navigate to the “drivers” folder of Arduino installation.
Click “Next” and you may get a security warning, if so, allow the software to be installed. Shown as below.
Once the software has been installed, you will get a confirmation message. Installation completed, click “Close”.
Up to now, the driver is installed well. Then you can right click “Computer” —>“Properties”—>“Device manager”, you should see the device as the figure shown below.
Let’s Get Started With Your Projects
Project 1: Hello World
Overview This project is very simple. You can use only a main board and a USB cable to display the “Hello World!”. It is a communication experiment between the EASY Plug control board and PC. This is an entry experiment for you to enter the Arduino programming world. Note that need to use a serial communication software, Arduino IDE. In the above part, you can check the detailed use of Arduino IDE.
Component Required:
- EASY plug control board*1
- USB cable*1
Component Introduction:
The processor used in keyestudio EASY plug control board V2.0 is ATmega328. It has 5 single Digital ports labeled D5 to D9 (of which 3 can be used as PWM outputs), 1 dual-digital interface (D3-D4), 4 analog inputs (A0-A3), a Joystick socket (D2-A6-A7), a SPI, a serial port and an IIC communication interface. Also with a USB connection, a power jack, two ICSP headers and a reset button. It breaks out the IO ports with RJ11 6P6C plug.
Connect It Up
Connect the control board to your computer via a micro USB cable.
Upload the Code
Below is an example code for displaying the Hello World!
int val; int ledpin=13; void setup() { Serial.begin(9600); pinMode(ledpin,OUTPUT); } void loop() { val=Serial.read(); if(val=='R') { digitalWrite(ledpin,HIGH); delay(500); digitalWrite(ledpin,LOW); delay(500); Serial.println("Hello World!"); } }
Select the Arduino Board
Open the Arduino IDE, you’ll need to click the “Tools”, then select the Board that corresponds to your Arduino.
Select your serial port
Select the serial device of the Arduino board from the Tools | Serial Port menu.
Note: to avoid errors, the COM Port should keep the same as the Ports shown on Device Manager.