Lesson 3: Arduino. Goals

Similar documents
Objectives: Learn what an Arduino is and what it can do Learn what an LED is and how to use it Be able to wire and program an LED to blink

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

Arduino Lesson 1. Blink. Created by Simon Monk

smraza Getting Start Guide Contents Arduino IDE (Integrated Development Environment)... 1 Introduction... 1 Install the Arduino Software (IDE)...

Rodni What will yours be?

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

Internet of Things Student STEM Project Jackson High School. Lesson 2: Arduino and LED

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Arduino STEAM Academy Arduino STEM Academy Art without Engineering is dreaming. Engineering without Art is calculating. - Steven K.

Welcome to Arduino Day 2016

FABO ACADEMY X ELECTRONIC DESIGN

Programming 2 Servos. Learn to connect and write code to control two servos.

Coding with Arduino to operate the prosthetic arm

1Getting Started SIK BINDER //3

INA169 Breakout Board Hookup Guide

Arduino An Introduction

Objective of the lesson

Module: Arduino as Signal Generator

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

CURIE Academy, Summer 2014 Lab 2: Computer Engineering Software Perspective Sign-Off Sheet

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

APDS-9960 RGB and Gesture Sensor Hookup Guide

ZX Distance and Gesture Sensor Hookup Guide

Arduino Workshop 01. AD32600 Physical Computing Prof. Fabian Winkler Fall 2014

Practical Assignment 1: Arduino interface with Simulink

Arduino

Milli Developer Kit Reference Application Published on Silver Spring Networks STAGE (

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

TWEAK THE ARDUINO LOGO

OverDrive for Kindle, Kindle Paperwhite, Kindle Voyage, and Kindle Oasis (not Kindle Fire and Fire Tablet) Contents

Sten-Bot Robot Kit Stensat Group LLC, Copyright 2013

The DesignaKnit Serial E6000 Link 1

ISSN: [Singh* et al., 6(6): June, 2017] Impact Factor: 4.116

LED + Servo 2 devices, 1 Arduino

Arduino Sensor Beginners Guide

Studuino Icon Programming Environment Guide

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Application Note. Communication between arduino and IMU Software capturing the data

Programming a Servo. Servo. Red Wire. Black Wire. White Wire

Sketch-Up Project Gear by Mark Slagle

LESSONS Lesson 1. Microcontrollers and SBCs. The Big Idea: Lesson 1: Microcontrollers and SBCs. Background: What, precisely, is computer science?

micro:bit Basics The basic programming interface, utilizes Block Programming and Javascript2. It can be found at

Downloading a ROBOTC Sample Program

Installation guide. Activate. Install your Broadband. Install your Phone. Install your TV. 1 min. 30 mins

Electronic Prototyping

Simple Servo USER Instructions

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

Servo Sweep. Learn to make a regular Servo move in a sweeping motion.

CONSTRUCTION GUIDE IR Alarm. Robobox. Level I

Physics 323. Experiment # 1 - Oscilloscope and Breadboard

The USELESS BOX. Procedure:

Arduino Setup & Flexing the ExBow

// Parts of a Multimeter

VEX IQ Troubleshooting Flowchart Controller & Controller Battery

Experiment 1: Robot Moves in 3ft squared makes sound and

Programmable Timer Teaching Notes Issue 1.2

Understanding the Arduino to LabVIEW Interface

Lesson 2 Bluetooth Car

MAKEVMA502 BASIC DIY KIT WITH ATMEGA2560 FOR ARDUINO USER MANUAL

ASCOM EF Lens Controller

WEEK. Learning Objective. Materials to Prepare LESSON

Light Emitting Diode IV Characterization

Pulse Width Modulation and

Parts List. Robotic Arm segments ¼ inch screws Cable XBEE module or Wifi module

TETRIX PULSE Workshop Guide

M-16DX 16-Channel Digital Mixer

SC16A SERVO CONTROLLER

A servo is an electric motor that takes in a pulse width modulated signal that controls direction and speed. A servo has three leads:

Appendix A. Selected excerpts from behavior modeling session Examples of training screens

Lets start learning how Wink s bottom sensors work. He can use these sensors to see lines and measure when the surface he is driving on has changed.

Ocean Controls KT-5221 Modbus IO Module

The µbotino Microcontroller Board

Some prior experience with building programs in Scratch is assumed. You can find some introductory materials here:

In this project you ll learn how to create a game, in which you have to match up coloured dots with the correct part of the controller.

tinycylon Assembly Instructions Contents Written by Dale Wheat Version August 2016 Visit dalewheat.com for the latest update!

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Setting up Pro Tools I/O & connecting a microphone for Recording

Name EET 1131 Lab #2 Oscilloscope and Multisim

1. Controlling the DC Motors

INTRODUCTION to MICRO-CONTROLLERS

Microcontrollers and Interfacing

Ev3 Robotics Programming 101

A STARTER GUIDE OF BOSON KIT FOR MICRO:BIT

PIR Motion Detector Experiment. In today s crime infested society, security systems have become a much more

Setup Download the Arduino library (link) for Processing and the Lab 12 sketches (link).

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

DASL 120 Introduction to Microcontrollers

Demon Pumpkin APPROXIMATE TIME (EXCLUDING PREPARATION WORK): 1 HOUR PREREQUISITES: PART LIST:

Tarocco Closed Loop Motor Controller

Using the Dragon NaturallyMobile Recorder

INTRODUCTION to MICRO-CONTROLLERS

Sodium Thiosulphate and hydrochloric acid

The Robot Builder's Shield for Arduino

The DesignaKnit USB E6000 Link 1 & 2

LoRa Quick Start Guide

Build a Mintronics: MintDuino

FRUIT BONUS 2 nd Generation 2004 AMCOE INC.

On the front of the board there are a number of components that are pretty visible right off the bat!

iphoto Getting Started Get to know iphoto and learn how to import and organize your photos, and create a photo slideshow and book.

EULAMBIA ADVANCED TECHNOLOGIES LTD. User Manual EAT-EOM-CTL-2. Alexandros Fragkos

Transcription:

Introduction: This project introduces you to the wonderful world of Arduino and how to program physical devices. In this lesson you will learn how to write code and make an LED flash. Goals 1 - Get to know your Arduino board and learn about some of its components. 2 - Write code to make an LED flash using the Arduino software. 3 - Upload the code you have written to your Arduino board. 4 - Challenge your skills! - Follow these Instructions one by one Test your project - Click on this to Test your project Save Save your project - Click on this to Save your work Page 1 - Lesson 3: Arduino

Step 1: Meet the Arduino What is an Arduino? An Arduino is a microcontroller that can be used to make interactive projects that are connected to switches and sensor, controlling lights, motors and speakers or even talk to a computer. They are brilliant for making things that communicate with the physical world. We are going to use it as the brains of our DIY Gamer, using the soldered buttons as our inputs. By the end of the term, you will have written a whole game for it, but today we are just going to write some simple code to get an LED flashing. First lets get to know the Arduino board. Power Pins Separate your DIY Gamer Holding the front firmly with one hand, and the back with the other, gently pull the back off the DIY Gamer. This separates the front with PCB from the back with the Arduino. Pick up the Arduino half and have a good close look. Analog Pins Microcontrolle r Chip Digital Pins Power Input Clock USB Connection 1. Can you find the Micro controller? This is the brains of the board. It talks to everything else gathering information and giving out instructions. 2. Can you find the Clock? This ticks at 16MHz. This means it tells the microprocessor to talk to the rest of the board 16 million times a second. That s a lot. 3. Can you find the USB connection? This allows you to connect the Arduino to your computer and not only transfers the code, but supplies the power. 4. Can you find the Digital PINS 0 13? Using code, these can be turned on or off or can read things that are on or off, or true or false, like a light or a motor. 5. Can you find the Analogue PINS A0 A5? These can be connected to read variable inputs like brightness, volume, temperature and pressure. Page 2 - Lesson 3: Arduino

Step 2: Write the flashing LED code 1. Plug in the LED Pick up an LED, You ll notice it has one leg longer then the other. In electronics when something is different about a component it is trying to tell us something like it has to go a certain way round or it won t work. The long leg is called an Anode, this is the positive leg which means it needs power. The short leg is called a cathode and this is the negative leg. Insert the long leg into pin13 and the short leg into the GND (ground) pin next to it on the Arduino. Long leg = + Short leg = - It should open a new blank file called sketch. 3. Write the set up code Every Arduino sketch needs a setup code that will be run once at the beginning. Type in this code to tell the Arduino that we are using PIN 13 as an output, and that we will be putting an LED in it. It will automatically colour itself if typed correctly. Page 3 - Lesson 3: Arduino

Step 2: Write the flashing LED code 4. Write a comment Comments are for us to read not the Arduino. They help to label your code making it easy for you and others to understand. Type // before text and the Arduino will ignore it and not include it in the compiled code. Add the following comments to your code. It should automatically be in grey. 4. Write the void loop function Once Set up is complete, it runs the first loop code. It will keep running this loop again, and again and again until you tell it to stop or remove the power. Add the void loop code shown in the box to: Tell pin13 to have high power (high = on) Do this for 1000 milliseconds (1 second) Tell pin13 to have low power (low = off) Do this for 250 milliseconds (1/4 of a second) Altogether, this is telling the led to turn on for 1 second and then off for a ¼ second. Again and again and again in a loop. Page 4 - Lesson 3: Arduino

Test your project Click the tick that looks like this to verify your project and compile the code. Mistakes Code is very fussy and likes everything to be just so. When you compile, any mistakes are listed in the bottom bar in red. Missed a capital letter? Missed semi-colon? Missed a curley bracket? It will be there somewhere. Treat is as a spot the difference game. When you see Done Compiling in the status bar, you are now ready to upload it to the Arduino. Save Save your project Click the arrow facing downwards that looks like this to save your code. Things to try Add comments to help remember what the code does. Page 5 - Lesson 3: Arduino

Step 3: Upload to the Arduino 1. Plug the USB cable from the laptop into the Arduino The board should now have the tiny green on LED lit to show it is getting power. 2. Select the board Go to the tools menu and select the board, Arduino Uno 3. Select the serial port Go to the menu Tools > Serial Port and select the port that the Arduino is connected to. This name should be something like / dev/tty.usbmodem on a mac, or COM3 or higher on a PC. To find out, you can disconnect your Arduino board and re-open the menu; the entry that disappears should be the Arduino board. Reconnect the board and select that serial port. Page 6 - Lesson 3: Arduino

Test your project Click the green arrow to transfer your code to the Arduino. Wait a few seconds, you should see the RX and TX LEDS on the Arduino board flashing. If the upload is successful, the message Done uploading. will appear in the status bar. Does the led in PIN 13 start to flash on for 1 second, then off for a ¼ of a second? If it does, well done! You ve just written your first Arduino sketch. Challenge: Change the speed Can you make it flash slower? Can you make it flash faster? Can you make it flash a word in Morse code? Well done, you ve finished. Why don t you swap Arduino Morse code with a friend? Page 7 - Lesson 3: Arduino