Halloween Pumpkinusing. Wednesday, October 17, 12

Similar documents
Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

Counter & LED (LED Blink)

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

Robotics and Electronics Unit 5

Digital Pins and Constants

Prototyping & Engineering Electronics Kits Basic Kit Guide

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Arduino Micro Breadboard Laboratory Interface Processor (Micro BLIP) User Manual

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

micro:bit Lesson 2. Controlling LEDs on Breadboard

1/Build a Mintronics: MintDuino

Procedure: Determine the polarity of the LED. Use the following image to help:

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

Quick Start by JP Liew

9 Output Devices: Buzzers

Arduino 05: Digital I/O. Jeffrey A. Meunier University of Connecticut

USB Type A Female Breakout Hookup Guide

TA0013 ARDUINO RFID UNO STARTER KIT

Blinking an LED 1 PARTS: Circuit 2 LED. Wire. 330Ω Resistor

SX1509 I/O Expander Breakout Hookup Guide

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

OpenSprinkler v2.2u Build Instructions

TLC5947 and TLC59711 PWM LED Driver Breakouts

Arduino Programming and Interfacing

This is the Arduino Uno: This is the Arduino motor shield: Digital pins (0-13) Ground Rail

Lesson 5: LDR Control

CS12020 (Computer Graphics, Vision and Games) Worksheet 1

Lab 2.2 Ohm s Law and Introduction to Arduinos

OpenSprinkler v2.1u Build Instructions

BUILDING YOUR KIT. For the Toadstool Mega328.

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

EPD Extension Kit User Manual

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

An FTDI connection: The ATtiny microcontrollers don t have a hardware UART External Crystal header pins for an optional crystal

Arduino 6: Analog I/O part 1. Jeffrey A. Meunier University of Connecticut

keyestudio Keyestudio MEGA 2560 R3 Board

Module 003: Introduction to the Arduino/RedBoard

USER MANUAL ARDUINO I/O EXPANSION SHIELD

DLP-RFID2-EDK2 SETUP PROCEDURE

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

ECGR 4101/5101, Fall 2016: Lab 1 First Embedded Systems Project Learning Objectives:

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

NAME EET 2259 Lab 3 The Boolean Data Type

Title and Modify Page Properties

AVR Intermediate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

How to Use an Arduino

VKey Voltage Keypad Hookup Guide

Freeduino USB 1.0. Arduino Compatible Development Board Starter Guide. 1. Overview

Build the Machine Science XBoard, with a programmable microcontroller.

Goal: We want to build an autonomous vehicle (robot)

The DTMF generator comprises 3 main components.

Copyright 2015 by Stephen A. Zajac & Gregory M. Wierzba. All rights reserved..spring 2015.

Forth for Education - 4E4th and 4E4th IDE

REQUIRED MATERIALS Epiphany-DAQ board Wire Jumpers Switch LED Resistors Breadboard Multimeter (if needed)

Lab 0: Wire Wrapping Project: Counter Board

T-Scratch Basics. Coding with IDE (Software)

Lesson 8: Digital Input, If Else

Building the FlipChip Tester

EEG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

PIC Dev 14 Surface Mount PCB Assembly and Test Lab 1

Rover 5. Explorer kit

PDF of this portion of workshop notes:

Arduino Uno. Arduino Uno R3 Front. Arduino Uno R2 Front

Introduction To Arduino

Quickstart CHAPTER 1. Powering Up. Installing the Software

Robotics/Electronics Review for the Final Exam

Itty Bitty City Code Companion Scratch Microduino Inc. - All Rights Reserved 1

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Documentation for Wifi-Enabled Data Logging - System Control By: Jesse Jenkins

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

Introducting Itsy Bitsy 32u4

ARDUINO M0 PRO Code: A000111

ArdOS The Arduino Operating System Quick Start Guide and Examples

3. The circuit is composed of 1 set of Relay circuit.

4Serial SIK BINDER //77

KNOCK LOCK MAKE YOUR OWN SECRET LOCKING MECHANISM TO KEEP UNWANTED GUESTS OUT OF YOUR SPACE! Discover: input with a piezo, writing your own functions

ARDUINO LEONARDO WITH HEADERS Code: A000057

PIC Dev 14 Through hole PCB Assembly and Test Lab 1

The GENIE Light Kit is ideal for introducing simple lighting projects, such as an electronic die, a wearable badge or a night-time warning system.

One Grove Base Shield board this allows you to connect various Grove units (below) to your Seeeduino board; Nine Grove Grove units, consisting of:

Techgirlz Workshop Scratch and Raspberry Pi

Laboratory 1 Introduction to the Arduino boards

Introduction to Arduino

ENGR 40M Project 4b: Displaying ECG waveforms. Lab is due Monday June 4, 11:59pm

Grelllbbb s ESP Flashamater Adaptimizer Assembly & User Guide

Micro-Controllers. Module 2: Outputs Control and Inputs Monitoring. IAT Curriculum Unit PREPARED BY. August 2008

Si4703 FM Radio Receiver Hookup Guide

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

Lab 0 Introduction to the MSP430F5529 Launchpad-based Lab Board and Code Composer Studio

Atmel Microprocessor Programming With AVRISPmkii

USB-COMi-TB USB to Industrial Single RS-422 / 485 Adapter Manual. Specifications and Features

Executive summary. Gather up the materials & tools required. Set up the BT2S for the ProChrono baud rate:

Ardusat Space Kits in the Classroom

Cygnos360 V2 Installation Manual

Advanced Strobe 1.0 Kit

In this activity you will create a tool to allow you to play games such as Red Light/Green Light. To create the game, follow the steps below.

Building your own special-purpose embedded system gadget.

Digital Flame 1.0 Kit

Transcription:

Halloween Pumpkinusing Blink LED 1

What you will need: 1 MSP-EXP430G2 1 3 x 2 Breadboard 3 560 Ohm Resistors 3 LED s (in Red Color Range) 3 Male to female jumper wires 1 Double AA BatteryPack 2 AA Batteries Computer running Energia +computer running Energia 2

Download Energia www.energia.nu Visit www.energia.nu go to the GETTING STARTED page follow the directions Download the LaunchPad Drivers Download the Energia application 3

Connect the LaunchPad We will be testing the microcontroller and running the Blink LED Program. 1. Start the Energia Application on your computer. 2. Open your LaunchPad and connect the USB Cable 3. Connect the LaunchPad to your computer. 4. Verify it all works. You should see a green and red LED light blink back and forth 4

Run LED Blink With the LaunchPad Connected. 1. Verify your board is selected and is correct. Tools--> Board-->MSP430G2553 (16 MHZ) 2. Open the Example File: Blink LED File--> Examples-->Basics--> Blink 5

Load Blink Load the LED Blink Example. Hit Upload Upload Program: click this to get the program onto the microcontroller. The Program getting loaded this is where you write and edit your code. Board Status: this is where you verify which board you are using and what COM Port. Status Window and Bar Status of Program Details of what was loaded Success = white 6

Load Blink Your LaunchPad should now be blinking the LED on for 1 second and off for 1 second. Don t close out this program, you ll be using it again. /* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */ void setup() { // initialize the digital pin as an output. // Pin 14 has an LED connected on most Arduino boards: pinmode(14, OUTPUT); } Program Start and Loop when turn on void loop() { digitalwrite(14, HIGH); // set the LED on delay(1000); // wait for a second digitalwrite(14, LOW); // set the LED off delay(1000); // wait for a second } Start the Program. Declare Pin 14 as an Output. Pin 14 is Pin P.16 on the LaunchPad If you decide to change which pin you want to use, you will need to declare it here. take Pin 14 and make it HIGH (this turns on the LED) Hold it for 1000 milli seconds (1 second) take Pin 14 and make it LOW (this turns off the LED) Hold it for 1000 milli seconds (1 second) 7

Part 1 Done! LED Blinking on LaunchPad! 8

Wire Up Breadboard 1 3 x 2 Breadboard 1 560 Ohm Resistor 1 LED any of the three 2 Male to female jumper wires Blue (GND or - wire) Red Wire (to pin or the +) 9

How does a Breadboard Work? Jumper cables are matched to the color. Rows are connected together sharing a common Bus or Wire connecting anything on the same row will be like wiring them together. To VCC or + To GND Columns are connected together sharing a common Bus or Wire The + and the - columns provide power, to get power to the rows, you need to connect the row to one of the columns. (usually the - ) 10

You will be creating this circuit. 1. Connect this jumper cable to VCC on the LaunchPad and to a Row on the side of the breadboard we are working on (use Row 7 for this purpose) 2. Connect the resistor from the negative (blue) column to a row on the breadboard. (use row 8 for this purpose). 3. The LED has a long and a short. This is the positive and the negative sides. Connect the LED to 2 rows, positive side on the row above. In this case, place the longer lead on Row 7 (same row as the red jumper) and the shorter Lead on Row 8 (same row as the resistor). 4. Connect this jumper cable to GND on the LaunchPad and to the - Row on the same side we are working on. 11

Part 2 Done! Congratulations! The LED Should be Blinking! If you want to add more LED s you can add those on other parts of the board. Just make sure that the LED has a resistor (you have 2 extra) connection to GND (-) //the blue jumper wire and a positive connection (one of the red jumpers that go to a pin on the MSP430. You can test the LED by connecting a Red Jumper Wire to VCC at any time (always is on). 12

13

Additional: - Change out the LED that is used, use the red, try the large yellow one -Try to wire another LED using VCC (to keep it on constantly) 14

Change the Program- Change the PIN Notice the original LED on the board (Green one) is blinking with the yellow LED you ve put on the breadboard. This is because both outputs are tied to the same power source (PIN 14). You may want to change that, to make sure that your yellow LED light isn t colored by the green LED light. To do that, you will need to change the PIN that the Yellow LED is blinking off of. 1. Look at your BlinkLED program (it should still be open). 2. Look for anyplace you see Pin 14 declared. 3. Replace the Pin 14, with Pin 6. 4. Hit Upload. 15

Change the Program- Change the PIN The Green LED should stop flashing on and off steadily. The only LED on is the one by the USB Cable (indicating Power). It s time to adjust the wiring to reflect the change. The power has moved from Pin 14 to Pin 6. We will need to take the Jumper Cable from Pin 14 and move it to Pin 6. These numbers may be different than the ones on the writing or silkscreen of the LaunchPad. The Pins that the program is referring to are the ones on the actual device the MSP430G2553. In this case you will be moving the Jumper on the LaunchPad from P1.6 on the right hand side to P1.4 on the left hand side. The Yellow LED Should Start Blinking every 1 second again. Pin1 2 3 4 5 6 7 8 9 10 VCC P1.0 P1.1 P.1.2 P1.3 P1.4 P1.5 P.2.0 P2.1 P2.2 Pin1 2 3 4 5 6 7 8 9 10 Pin 20 19 18 17 16 15 14 13 12 11 GND XIN XOUT TEST RST P.1.7 P.1.6 P2.5 P2.4 P2.3 Pin 20 19 18 17 16 15 14 13 12 11 Pins on the device coordinated with the silkscreening on the LaunchPad IF you change the device, the pin assignments will change. 16

Blinking LED only on the Breadboard! Try changing the pin around for the LED on the breadboard. Remember you have to change the code and then move the jumper 17

Change the Program- Change the Flashing Now that you have the LED on the breadboard flashing on it s own for 1 second on and 1 second off, it s time to change the timing. Go back to your code window In the code there is a function delay(1000). This means, hold the function previous for 1000 milliseconds = 1 Second. You ll notice that the number is in black. This means that you can change it whatever you d like. Once you change the number, hit UPLOAD and watch the difference in how the LED on the breadboard behaves. I suggest trying 5000 for and 2000 then trying 35 and 70 *If you run into a situation where the LED Stops turning on or seems to be on all the time and not turning off, you may have the delay interval too long or too short. Change the numbers closer to 1000 to test it. For something similar to a candle flicker, use the shorter times like 35 on and 70 off 18

Preview of Next Lesson: Multiple LED s perhaps your LED isn t bright enough to light your pumpkin, or you want to get a better flicker effect. Adding multiple may be the route you d like to take. If you only want to have an LED flickr the same way as the first, you only need to add the LED next to the existing one. If you want to have both LED s flash at different rates, you will need to change the program and add that LED. Just remember, you will first need to wire up the breadboard with the additional LEDs and incorporate the new LED s into the program. This is a preview of the next lesson. All of the LED s connected to same Rows so they flicker at the same rate. Large LED is constantly on with the red and yellow flickering at the same rate. 19

Preview Cont. 20

Additional Info 21

Connecting your project to a Batteryyou might want to have your project more portable than needing to have a USB cable connected to your computer (e.g. inside of a pumpkin). You have a few options: 1. ) you can get an external battery pack USB Powered 2.) you can connect using AA batteries (included for some). IF you select Option 1, it is the easiest. Just replace the computer with the Battery Pack and turn on. The LaunchPad will continue to be powered through the on-board USB. However, Option 2 does require a little work, but may be more cost effective. 22

Connecting your project to a Battery AA pack 1. You will need to make sure to find the negative and positive wires on the battery pack. This should align nicely with if the battery wire starts at the negative terminal or positive. Negative or Black Wire 2. Follow these negative and positive to the ends to the white connector. Positive or Red Wire 23

3. Connect the White Connector to the GND and VCC in the bottom right hand corner of the LaunchPad. The silkscreen reads GND GND VCC which corresponds to the connector s - blank + DON T PLUG IN BACKWARDS. There is very little protection circuitry on the LaunchPad! The LaunchPad should light up now. once the LaunchPad is powered and you see your program running, you will need to disconnect the headers. These headers connect power from the battery to the power source of the USB cable. Since you do not need the USB to save battery life you should disconnect that portion. However, if you think you may want to re-program the Launchpad, you will need to keep the headers and put them on before trying to re-program it. (the headers just slide off the tops of the pins). 24

Power and JTAG Headers this connects the microcontroller to the USB Power and the data. Disconnect to save battery life. Match VCC to red and GND to Black. Don t plug in backwards. Header Pins, must replace these in order to re-program the microcontroller 25

Energia Let s first look at Energia Menu Bar Check Program: check your code without having to re-program the microcontroller. Upload Program: click this to get the program onto the microcontroller. Editor Window: this is where you write and edit your code. Board Status: this is where you verify which board you are using and what COM Port. Debug Window: if there are errors in your code they will appear here in orange. This is where we can see successful actionsdisplayed in white. 26

Sketch The program in Energia is called a Sketch Set-Up: You will need to set up any thing that the microcontroller uses. This is where you declare what Pins and how they are used. Pins are the different leads on the microcontroller. stage. this needs a declaration of a section void and then the section type setup followed by a empty parenthesis (){ contents} You can add as many of these are you want, but it will break the program into chapters Comments: Anything in Green is a Comment. You can start a comment by writing the ffor a single line write //comment or for many lines /*comment*/ Program:: This is what initiates a program. This is where you tell the microcontroller what to do. native functions or Actions. these are instructions that are part of Energia. They show up as orange. if you use one, you will need function (what you are targeting, TYPE) You may choose which Action you want;, but you cannot change how the Action works. program declarations required program stage- choose comments- whatever you wish, does not load into microcontroller functions- confined to a select list user inputs - whatever you wish, as long as it makes sense within the action it s being used in TYPE: you can choose from the list ; (semi colon) designates the end of a function, you need one for every function { (open bracket) begin a section } (close bracket) we end a section 27