Lesson 3: Arduino. Goals

Similar documents
Arduino Lesson 1. Blink

Bluetooth + USB 16 Servo Controller [RKI-1005 & RKI-1205]

Lesson 8: Simon - Arrays

1-10 The USB PIC K150 microcontroller programmer Hardware version V2.0 File version V2.0 Product Image

POINTS POSITION INDICATOR PPI4

Ethernet Radio Configuration Guide

#include <Gamer.h> Gamer gamer; void setup() { gamer.begin(); } void loop() {

CAN-Bus Shield Hookup Guide

Your Multimeter. The Arduino Uno 10/1/2012. Using Your Arduino, Breadboard and Multimeter. EAS 199A Fall Work in teams of two!

Arduino Lesson 16. Stepper Motors

How to setup a serial Bluetooth adapter Master Guide

Contents Contents Contents Overview Charging your headset Wearing the headset Powering on the headset Connecting your headset for dictation

TPG MOBILE BROADBAND QUICK SETUP GUIDE

An Introduction to MPLAB Integrated Development Environment

INTRODUCTION TO SERIAL ARM

Lab Experiment 1: The LPC 2148 Education Board

Now your IviumSoft has been upgraded. After this proceed to upgrade the firmware of your instrument.

4 Setting up Broadband 10 Setting up Fibre Broadband 16 Moving from Broadband to Fibre Broadband

Time Attendance V1.0

Sync Guide. Sync Overview. Before the Event. During the Event. After the Event. Greater Giving Event Software

5050 Getting Started

Digital Photo Bank / Portable HDD Pan Ocean E350 User Manual

CM HOST CM CardTransporter Fuel Communication and Management Software Software version up to 3.1

DSO138 oscilloscope program upgrade method

If this PDF has opened in Full Screen mode, you can quit by pressing Alt and F4, or press escape to view in normal mode. Click here to start.

SMARTstuff. The first rule for using an interactive whiteboard is very simple and of the utmost importance: Have faith in yourself you can do this!

Eric Mitchell April 2, 2012 Application Note: Control of a 180 Servo Motor with Arduino UNO Development Board

Animated Lighting Software Overview

K128. USB PICmicro Programmer. DIY Electronics (HK) Ltd PO Box 88458, Sham Shui Po, Hong Kong. mailto:

The $25 Son of a cheap timer This is not suitable for a beginner. You must have soldering skills in order to build this kit.

How To Set Up A Smart Card Programmer With Titan (Titan) And Titan 2.3 (Tok) (Tonga) (Powerbook) (Smart Card) (Programmer) (S

DS1307 Real Time Clock Breakout Board Kit

PHYS 2P32 Project: MIDI for Arduino/ 8 Note Keyboard

Programming the VEX Robot

CONTENTS. What is ROBOTC? Section I: The Basics

Theory and Practice of Tangible User Interfaces. Thursday Week 2: Digital Input and Output. week. Digital Input and Output. RGB LEDs fade with PWM

EPSON Stylus. Start Here

Getting started with the O Watch

Let s Get Connected. Getting started with your Wireless Modem.

23425 USB DAC FAQ. My DAC is plugged into my PC but I get no audio or I get sound out of my laptop speakers. What gives? Windows Vista / 7:

Mobile Broadband Manager Guide Huawei E8278

PolyBot Board. User's Guide V1.11 9/20/08

Arduino Lesson 0. Getting Started

User Guide Reflow Toaster Oven Controller

LOK-IT ENCRYPTED USB Administrator User Instructions

How to connect to a Class II router using a mobile-phone data cable specifically for Solwise & Safecom routers

C4DI Arduino tutorial 4 Things beginning with the letter i

Programming Device Manual Booklet AVR Prog USB v2

Points Position Indicator (PPI1) for Points Motors with Common Ground

The easy way to accept EFTPOS, Visa and MasterCard payments on the spot. Mobile Users Charging your PayClip. 2. Downloading the PayClip app.

MS830 / MS833 Barcode Reader v1.0 9-December-2014

Sky Broadband upgrading your router software

FTDI VCP DRIVER (free) (WIN/MAC/LINUX)

Introduction to Arduino

Now with. Quick Start. User Guide Vodafone Mobile Broadband USB Stick K3773. Designed by Vodafone

Configuring the Siemens TC35 modems for use with the MI2292

TUTORIAL 3 :: ETHERNET SHIELD AND TWITTER.COM

Installation, Setup, & Uninstall Guide Virtual TimeClock 15 Network Edition for Mac

2013 G Miller. 3 Axis Brushless Gimbal Controller Manual

Madi, The Little Paper Pantry

KTA-223 Arduino Compatible Relay Controller

How To Program An Nxt Mindstorms On A Computer Or Tablet Computer

ezsystem elab16m Project 1F: Alarm System (Full Project description)

User's Guide DylosLogger Software Version 1.6

PLC training panel (Twido version)

Six-servo Robot Arm. DAGU Hi-Tech Electronic Co., LTD Six-servo Robot Arm

Designed for Vodafone

Welcome to John Lewis Broadband

Installing the Gerber P2C Plotter USB Driver

Zoom Participant Guide

Using the Communication Ports on the DG-700 and DG-500 Digital Pressure Gauges

TELUS Internet set up guide. Read me first

AUDITVIEW USER INSTRUCTIONS

Coyote SP - Installation Notes

Work with Arduino Hardware

Arduino project. Arduino board. Serial transmission

Quick Start Guide Ski Doo Snowmobiles

Connecting your Omega/BetaPAT PLUS to a PC via a USB

iloq P10S.10/20 Programming device User's Guide

4/Really Getting Started with Arduino

USB Driver Installation for Windows XP

Mobius 3 Circuit Board Programming Instructions

INSTRUCTION MANUAL All-In-One GSM Home Alarm System SB-SP7200-GSM

Audience Response System (Turning Point) A Quick Start Guide

Table of Contents. Use. Troubleshooting. Setup. Welcome. 11 How to arm/disarm system/camera(s) 19 Sync Module setup issues. 3 Installing the Blink app

WIRELESS INTERNET TROUBLESHOOTING GUIDE Help Desk

SB101 SMART Board 101

WELCOME TO VERIZON HIGH SPEED INTERNET FOR BUSINESS

Programming and Using the Courier V.Everything Modem for Remote Operation of DDF6000

InfiniTV 4 Installation Instructions

Waspmote. Quickstart Guide

GUARD SENIOR. manual

- 35mA Standby, mA Speaking pre-defined phrases with up to 1925 total characters.

Board also Supports MicroBridge

3. USB DRIVER Installation of USB driver Driver for Infinity SD Data Logger. INFINITY Series Acquisition Tools Manual

Modern Robotics, Inc Core Device Discovery Utility. Modern Robotics Inc, 2015

FX-BTCVT Bluetooth Commissioning Converter Commissioning Guide

Internet User Guide. For the ZTE H298N routers. LAN4 LAN3 LAN2 LAN1 WAN Phone USB2 USB2 WAN WLAN WLAN WLAN

IR Communication a learn.sparkfun.com tutorial

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. They can control lights, motors and speakers and 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, (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. The long leg is called an Anode, this is the positive leg which means it needs to be on the positive side of the circuit. The short leg is called acathode and this is the negative leg. They must be placed in a circuit the correct way round to work! 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. 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