Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Upcoming SlideShare
Loading in...5
×
 

Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009

on

  • 7,026 views

CS4062 Masters in Interactive Media - Fourth Arduino Lecture - March 18th 2009 - University of Limerick. This lecture presents a short review and introduction to programming concepts relevant to ...

CS4062 Masters in Interactive Media - Fourth Arduino Lecture - March 18th 2009 - University of Limerick. This lecture presents a short review and introduction to programming concepts relevant to Arduino. This was aimed at a digital media / music technology masters student audience.

Statistics

Views

Total Views
7,026
Views on SlideShare
4,151
Embed Views
2,875

Actions

Likes
6
Downloads
363
Comments
0

58 Embeds 2,875

http://braz.blogspot.com 2122
http://www.maffucci.it 145
http://braz.blogspot.ie 80
http://braz.blogspot.co.uk 71
http://braz.blogspot.com.au 63
http://braz.blogspot.mx 60
http://braz.blogspot.com.br 31
http://braz.blogspot.com.es 30
http://translate.googleusercontent.com 24
http://braz.blogspot.se 24
http://braz.blogspot.ca 22
http://braz.blogspot.ru 19
http://braz.blogspot.fi 19
http://braz.blogspot.com.ar 17
http://braz.blogspot.in 13
http://braz.blogspot.it 13
http://braz.blogspot.de 11
http://braz.blogspot.fr 11
http://braz.blogspot.co.nz 10
http://braz.blogspot.kr 9
http://braz.blogspot.cz 8
http://braz.blogspot.hu 6
http://www.slideshare.net 6
http://braz.blogspot.be 5
http://www.braz.blogspot.com 4
http://braz.blogspot.pt 4
http://braz.blogspot.gr 3
http://braz.blogspot.dk 3
http://braz.blogspot.co.il 3
http://xoomer.virgilio.it 3
http://braz.blogspot.nl 3
http://braz.blogspot.ro 2
http://www.google.com 2
http://braz.blogspot.tw 2
http://braz.blogspot.sk 2
http://braz.blogspot.jp 2
http://www.braz.blogspot.com.br 2
http://braz.blogspot.no 1
https://www.linkedin.com 1
http://devel.slideee.com 1
http://braz.blogspot.ae 1
http://braz.blogspot.com.tr 1
http://highs27.rssing.com 1
http://www.slideee.com 1
http://www.directrss.co.il 1
http://131.253.14.66 1
http://braz.blogspot.co.at 1
http://braz.blogspot.sg 1
http://74.125.87.132 1
http://mytopfreegames.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009 Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009 Presentation Transcript

  • Programming the Arduino CS4062 - Eoin Brazil - Semester 2 - 2009 http://www.flickr.com/photos/collinmel/2317520331/
  • Programming an Arduino Write program Compile (check for errors) Reset board Upload to board
  • An Arduino “Sketch” Declare variables at top Initialize setup() – run once at beginning, set pins Running loop() – run repeatedly, after setup()
  • An Arduino “Sketch” int ledPin = 13; – led connected to control pin 13 int aSensor = 0; – setup Global Variables sensor 'aSensor' on analog pin 0 int statePin = LOW; – use this to hold the state of a pin
  • An Arduino “Sketch” pinMode() – set a pin as input or output setup() serial.Begin() – setup to `talk' to the computer
  • An Arduino “Sketch” pinMode(ledPin, Output); – set the pin `ledPin' as an output setup() serial.Begin(9600); – talk to the computer at 9600 baud rate
  • An Arduino “Sketch” digitalWrite() – set a digital pin high/low digitalRead() – read a digital pin’s state analogRead() – read an analog pin loop() analogWrite() – write an “analog” PWM value delay() – wait an amount of time millis() – get the current tim
  • `C’ language char - ascii character, 8 bits short - short integer, 16 bits, -32768 to 32767 int - default integer, 16 or 32 bits long - large integer, at least 32 bits float - 32 bit floating point (e.g. 3.13) double, long double - 64 bit or greater
  • Character constants `A’ - upper case A `n’ - newline character `t’ - tab character `0’ - null character (it is digit not char) `012’ - character with octal value of 12 which is decimal 10
  • Commenting and Operators `//’ - single line comment `/* .... */’ - multiline comment + Addition - Subtraction * Multiplication / Division % Remander (mod) == != <= >= < > = is not ==
  • More Operators Boolean operators ! - not && - and || - or if (<statement>) { <statement/s> } if - else while (<statement>) { <statements/s> } Essential C - http://cslibrary.stanford.edu/ 101/