Making things sense-Day 2 (May 2011)
Upcoming SlideShare
Loading in...5
×
 

Making things sense-Day 2 (May 2011)

on

  • 1,242 views

Slides for the Edge Workshop

Slides for the Edge Workshop

Statistics

Views

Total Views
1,242
Views on SlideShare
1,242
Embed Views
0

Actions

Likes
0
Downloads
39
Comments
0

0 Embeds 0

No embeds

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

    Making things sense-Day 2 (May 2011) Making things sense-Day 2 (May 2011) Presentation Transcript

    • Making things senseUrban sensing and physical computing Day 2 (7-8 May 2011) Markus Rittenbruch QUT Urban Informatics / FAST & NICTA
    • Schedule - Day 2• 12:00 - 12:10 Introduction• 12:10 - 12:30 Analogue sensors• 12:30 - 13:00 Activity• 13:00 - 14:00 Sharing sensor data• 14:00 - 14:10 Short break• 14:10 - 16:10 Project activity• 16:10 - 16:50 Project presentations• 16:50 - 17:00 Wrap up
    • Making things sense - Day 2
    • Programming
    • ProgrammingData types When variables are made to exceed their maximum capacity they "roll over" back to their minimum capacity, note that this happens in both directions. int x x = -32,768; x = x - 1; // x now contains 32,767 - rolls over in neg. direction x = 32,767; x = x + 1; // x now contains -32,768 - rolls overFloat & casting:
    • ProgrammingFloat & casting: int x; int y; float z; x = 1; y = x / 2; // y now contains 0, ints cant hold fractions z = (float)x / 2.0; // z now contains .5 (you have to use 2.0, not 2)
    • Resources• Language reference: • http://www.arduino.cc/en/Reference/HomePage • http://arduino.cc/en/Reference/Extended • General code library: • http://arduino.cc/en/Reference/Libraries• Interfacing with hardware: • http://www.arduino.cc/playground/Main/InterfacingWithHardware• Examples • http://arduino.cc/en/Tutorial/HomePage
    • Analogue sensors
    • Analogue sensor pins• Use analogue in pins 0-5 for analogRead()• Address as 14-19 when used as digital pins • digitalWrite(), digitalRead()• No pinMode required for analogRead();
    • Analogue sensor input• File/Examples/Analog/AnalogInput
    • Analogue sensor input
    • Programming Conditionals http://www.ladyada.net/learn/arduino/lesson5.html
    • AnalogInput
    • Calibration - part 1
    • Calibration - part 2• map(): remap a number from one range to another • val = map(val, 0, 1023, 0, 255);• constrain(): constrain to a number range
    • Project activity 1 - Calibration
    • Components • RGB LED:
    • Components• LED matrix http://www.sparkfun.com/datasheets/Components/LED/YSM-1288CR3G2C.pdf
    • Components • MAX7219 LED driverhttp://arduino.cc/playground/Main/MAX72XXHardwarehttp://www.arduino.cc/playground/Main/LEDMatrix
    • Project activity II - Projects
    • So, you’ve got an Arduinoand now you want tomake it talk
    • Or, maybe you want totalk to it...
    • ...from the other side of the world
    • This session of the workshop willshow you some ways of doing that.
    • Arduino to the world• Arduino direct to Pachube via ethernet/wifi shield• Or Arduino to PC via serial, then to Pachube/Twitter• We’re taking the second approach in this workshop, since the kits we provided don’t include ethernet/wifi shields
    • Step 1: Register a feed on Pachube
    • Step 2: Write some code
    • Arduino Sketch
    • Ruby “Bridge”: setup
    • Ruby “Bridge”: the loop
    • Step 3: See your data on Pachube
    • Advanced topics• PCB design• Wireless communication • Xbee • Bluetooth • Wifi • Infrared • Radio• Real-time communication• Multi-tasking
    • Resources• http://apiwiki.twitter.com/• http://community.pachube.com/api• http://community.pachube.com/tutorials• http://community.pachube.com/triggers/ twitter
    • What next?• Hackerspace Brisbane • http://hackerspaces.org/wiki/Hackerspace_Brisbane• Living Dolls (The Edge) • http://edgeqld.org.au/blog/2011/04/07/living-dolls/