You are on page 1of 14

SENG 466 / CSC 57whatever Lab 1: Introduction

Neil MacMillan January 06, 2012

Outline

How this lab works Scheduling Intro to Arduino programming

Lab Structure

Pretty ad hoc / organic Lab time from 8:30 to 10:30 on Friday mornings I will be here at 8:30 and will talk to the group about stuff at around 9:30.

Lab Structure

I will do the rounds between 8:30 and 10:30


Check in with all the groups Check log books?

Useful resource:
http://nrqm.ca/mechatronics-lab-guide

Schedule

I am working full time until the end of February I will be here Friday mornings and Wednesday afternoons, working on my own stuff If I am in the lab, I am available for TA mode no matter what I'm working on

Lab "Lecture" Schedule


1: You are experiencing this right now 2: Lab tools, soldering 3: Electrical stuff, tips on avoiding injury 4-10: Student request (I haven't planned this far ahead)
possible topics include:

expanding on various parts of the lab guide, e.g. using the radio, embedded system code design, real-time task switching, reading hardware specification documents reinforcing lecture material greater depth on hardware, electronics, other practical material quick information-sharing sessions

Arduino Programming

Arduino is several things:


Programming language/preprocessor Microcontroller Library IDE

Programming language:

Simplified version of C/C++ We will not use this, we will use real C

Arduino Microcontrollers

Lots of different Arduino and Arduinocompatible devices We use two: Seeeduino Mega and Arduino Uno
Seeeduino: 128 KB memory, 86 I/O pins, 4 UARTs Uno: 32 KB memory, 20 I/O pins, 1 UART

Arduinos based on AVR8 core


Same architecture, same development tools, slightly different peripheral interface Most differences abstracted away by Arduino library

Arduino Libraries

Built on top of WinAVR libraries Core library provides functions for:


Timing UART (serial port communications) Digital and analog I/O

Peripheral libraries for:


TWI (I2C) Servos

Our own libraries


Radio, sensors

Arduino IDE

Highly simplified, made for non-programmers I don't recommend using this, but you can if you want to. I will demonstrate setting up the Eclipse IDE

Could also use AVR Studio, Notepad++, Emacs, vi, ed, etc. as long as you compile with WinAVR Reach a consensus on IDE usage within your group

Setting Up the Environment

Recommendations:
Use Eclipse/WinAVR for development Don't use the lab machines, use your own laptop

Instructions:
http://nrqm.ca/mechatronics-lab-guide/lab-guidesoftware-environment/

Misc. Comments

Use C, not C++ If you do something differently and it works well, tell me so I can update my documentation Students of the future will read your code Arduino pin numbers are MESSED UP

Arduino Program Demo

Goals:

Set up a project in Eclipse Write a simple program using the Arduino core library Upload the program to the microcontroller

I'll go fast, the information is all in the lab guide

Task List for This Week


1) Compile blinky program 2) Upload blinky program to hardware 3) Make Arduino program to talk over serial
e.g. Simple echo program

4) Get gamepad script running 5) Transmit gamepad data to Arduino over serial 6) Use gamepad to do something interesting
e.g. Control the blinking rate

You might also like