20
>_ Things Lab An hour of Arduino and Ardublock Introductory workshop Computer Science Education Week Week of Code in Things Lab

An Hour of Arduino and Ardublock

Embed Size (px)

Citation preview

>_ Things Lab

An hour of Arduino and Ardublock

Introductory workshop

Computer Science Education Week

Week of Code in Things Lab

What is Arduino?

• Arduino is a a single board microcontroller and also an Open Source development environment, used to create functional and creative projects (also a powerful base platform for DIY projects).

Components

• Arduino is attached to a breadboard and connected to a computer via a USB cable.

• Components we are going to use for the workshop include: LEDs, resistors (330 and 10K ohms), photoresistors, wires, but there are a lot of other ones.

Ardublock

• Arduino is programmed in a language based on C, called Wiring.

• Today we are not going to learn to actually program Arduino using Wiring, but something much simpler and fun, called Ardublock.

• It is a graphical programming environment used to make the Arduino programming as simple as drag and drop.

How to get Arduino IDE and Ardublock?

• Link for dowloading Arduino IDE:

http://arduino.cc/en/main/software

• Link for dowloading Ardublock:

http://blog.ardublock.com/engetting-started-ardublockzhardublock/

Installing Ardublock…

• Open C:\Users\<username>\Documents\Arduino

• Create a folder named ‘tools’, inside it create a folder named ‘ArduBlockTool’, againg, inside it create a folder named ‘tool’ and copy there the ardublock-all.jar files.

• !!! Careful, the folder names are case-sensitive!!!

• Open Arduino IDE. Under the menu <Tools> you should have ArduBlock. Click it and… Voila! Let the fun begin

Hello, world! | Blinking Led

ArduBlock scheme

Traffic Light? Challenge accepted!

• Now that you’ve learn how to turn ON and OFF a LED, you can make a traffic light using three ones.

• The logic goes this way: each LED is connected to a digital pin, e.g #1, #2, #3. At first, all LEDs are off. Then, #1 is ON, others still OFF. #2 becomes ON, #1 goes OFF. #3 goes ON, #2 goes OFF. Can you make it?

You’ve got 15 minutes!

• The one that finishes first, meaning scheme done right and code working, will get a COOL PRIZE!

• 20, 19, 18 …

One of a lot of possible solutions

Photoresistor

• An alternative of Ardublock is BlocklyDuino. Link: http://www.gasolin.idv.tw/public/blockly/demos/blocklyduino/index.html

• Now that you’ve got some basics of Arduino, you can start to program it using real code and explore more by yourself. You can find a lot of tutorials/examples/schemes/code online.

Thank you for your time and attention!

• >_ Things Lab

• Week of Code, 10th December 2014

• Computer Science Education Week