ARDUINO

From Interaction Station Wiki
Jump to: navigation, search
Arduino-logo-vector.png

Arduino is an open-source physical computing platform based on a simple input/output (I/O) board and a development environment that implements the Processing language. Arduino can be used to develop standalone interactive objects or can be connected to software on your computer.

WHAT CAN YOU DO WITH ARDUINO?

HARDWARE/SOFTWARE INTERACTION

Arduino is composed of two major parts: the Arduino board, which is the piece of hardware you work on when you build your objects; and the Arduino IDE, the piece of software you run on your computer. You use the IDE to create a sketch (a little computer program) that you upload to the Arduino board. The sketch tells the board what to do.

EXAMPLE OF PROJECTS

Example_of_projects

ARDUINO BASICS

Get your Arduino board and link it to your software

There are several types of Arduino boards. Once you have chosen which board you want to work with, plug it to your laptop via USB. For your software to communicate with your board properly, it needs to understand which board it is sending information to.

Go to "tools" > "boards", and select so right board so that your software recognizes it.

Board.png

You also need to define which port is used for the information to be transfered. Port generally include bluetooth and USB entries.

Go to "tools" > "port", and select the right port for your laptop to communicate with your board.

Port.png

Ports start at zero, then 1, 2, 3, etc... In the example above, the port number is port number 2. (Maybe you don't need to know this at this stage, but keep it in mind, it might come in handy later)

Upload your sketch to the software

A really nice thing about Arduino is that they have a bunch of sketches (codes) that you can just directly upload from the software. Here we'll upload to our file a basic sketch to make an LED blink.

Go to File ---> Examples ---> Basics --->Blink

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  Most Arduinos have an on-board LED you can control. On the Uno and
  Leonardo, it is attached to digital pin 13. If you're unsure what
  pin the on-board LED is connected to on your Arduino model, check
  the documentation at http://www.arduino.cc
 
  This example code is in the public domain.
 
  modified 8 May 2014
  by Scott Fitzgerald
 */
 
 
// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}
 
// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

GOOOD! So this code should be in your file now... lets dissect it.

  • the //lines are commented out, meaning they are not read by the machine. It's a way to be able to write little comments to explain your code without it interfering with the actual code.
  • to comment out several lines or a paragraphe, you can use /* commented out paragraph */

Void Set Up/ Void Loop

You'll notice that your code is divided into 2 parts, the void Setup, and the void Loop. You can read in the commented out section that the setup function runs once when you press reset or power the board, while the loop function runs over and over again forever.

SENDING THE CODE TO THE ARDUINO

Compile your sketch

To compile your code means to verify it. Since this one was written for you, there are very few chance that the compiler reacts. Once you start writing your own codes, compiling will help you see where errors might be situated. Always compile your code before uploading them to your board.

Click on the upper left button that looks like a tick symbole.

Compile.png

Observe the messages appearing in the bottom of the Arduino software window.
(there should be a sentence saying Done Compiling when the file has compiled into your board)

Lets upload this

All you need now is to upload this code to your board.

Upload.png

And you should now have a Blinking aka Flashing LED on board.

Arduino-LED-Overview.jpg

OK, so your Arduino flickers, that was a Hello World!'

</div>

HARWARE

Arduino-uno.png

Circuit green.png

CIRCUIT MAKING

In the "circuit making" section, you’ll find all the resources to understand what it means to build a circuit through which electricity -- and your code -- are going to exist. You can find the basic electronic knowledge you need to get started with your project.

Basic components and their use

Resistors

Capacitors

COMPONENTS YOU CAN USE FOR YOUR PROJECTS

An overview of all components/hardware, that you can use while making your project with arduino. Use this list to get inspired, slide down for more technicities.

MOTORS AND DRIVERS

SENSORS


ARDUINO AND SOUND


ARDUINO AND VISUALS

EXTRA RESOURCE