P&O3 session 1

Post on 28-Jan-2015

122 views 0 download

description

Probleemoplossen en Ontwerpen slides. Course at KU Leuven 2nd year engineering science students.

Transcript of P&O3 session 1

PenO3Sessie 1

Erik DuvalSven Charleer - Jose Luis Santos - Nick Vannieuwenhoven

14.00:PenO3 Quantified Self Quantified Learning14.20: Raspberry Pi14.40: Hands on15.45: Break16.00: Arduino16.20: Hands on18.00: Done

PenO

eerste keuze?

tweede keuze?

derde keuze?

vierde keuze?

vijfde keuze?

PenO 1?

Probleemoplossen en Ontwerpen

• Ingenieursvaardigheden

• Modelleren en simuleren

• Experimenteren

• Methodische aanpak

• Teamwerk

• Integratie vakken

• Smaakmaker voor andere vakken

Over semesters

• gesloten, vak-overschrijdend probleem

• grafisch modelleren, ICT-werktuigen

• gesloten ontwerp

• modelleren en ontwerpen

• open ontwerp

• methodiek, reverse engineering

• ook: samenwerking in groepen

Tools

• Wiki: http://ariadne.cs.kuleuven.be/wiki/

• Wordpress: http://wordpress.com/

• Backlog at the wiki

•One for each group

Wiki

• Group Information (You can take a look to Peno3 last year)

• Pointers to your work (blog URL, ...)

Session report

• What did you do last session?

• What did you learn?

• How did you do it?

• Main problems?

Quantified Self

Little Brother

http://www.fitbit.com/

http://nikeplus.nike.com/plus/

http://www.moves-app.com/

http://memoto.com/

Quantified Learning

http://navi-hci.appspot.com/

http://mume11.snakeflash.com/

...-1980s

1990s

http://shop.pimoroni.com/

https://vimeo.com/55658574

Pi setup

Raspberry Pi Basics

login: pi

password: raspberry

config: sudo raspi-configxwindows: startx

shutdown: sudo shutdown -h now

restart: sudo shutdown -r now

GPIO

GPIO 3.3V

GPIO 3.3V

GPIO ProgrammingPython

RPi.GPIO module

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''''##"Use"board"pin"numbering

GPIO ProgrammingPython

RPi.GPIO module

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''##"Use"board"pin"numbering

GPIO ProgrammingPython

RPi.GPIO module

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''''##"Use"board"pin"numberingGPIO.setup(7,'GPIO.OUT)'''##"Setup"GPIO"Pin"7"to"OUTGPIO.output(7,True)''"""""##"Turn"on"GPIO"pin"7

GPIO ProgrammingPython

RPi.GPIO module

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''''##"Use"board"pin"numberingGPIO.setup(7,'GPIO.IN)''''##"Setup"GPIO"Pin"7"to"INresult.='GPIO.input(7)''""##"Read"GPIO"pin"7

Hands-on!

Hello World

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''##"Use"board"pin"numberingGPIO.setup(7,'GPIO.OUT)'''##"Setup"GPIO"Pin"7"to"OUTGPIO.output(7,True)''"""""##"Turn"on"GPIO"pin"7

import'RPi.GPIO'as'GPIO'''##"Import"GPIO"libraryGPIO.setmode(GPIO.BCM)''##"Use"board"pin"numberingGPIO.setup(7,'GPIO.IN)''''##"Setup"GPIO"Pin"7"to"INresult.='GPIO.input(7)''""##"Read"GPIO"pin"7

http://www.youtube.com/watch?feature=player_embedded&v=zE5PGeh2K9k

http://www.instructables.com/id/Power-Laces-the-Auto-lacing-shoe/

http://www.youtube.com/watch?feature=player_embedded&v=ZtNEPkwCfxA

Arduino Basics

Powered by USB

Data transfer by USB

Digital pins + Analog pins

Arduino Programming

Arduino Development Environment

Language based on C

http://arduino.cc/en/Reference/HomePage

Arduino Programming

Arduino Programming

Python?

void'setup()'{}

void'loop()'{'''}

Arduino Programming

void'setup()'{'''//a'comment'in'the'setup'section'which'is'run'once''.Serial.begin(9600);}

void'loop()'{'''}

Arduino Programming

void'setup()'{'''//a'comment'in'the'setup'section'which'is'run'once'''Serial.begin(9600);}

void'loop()'{'''//a'comment'in'the'loop'section,'which'is'looped'forever'''int'sensorValue'='analogRead(A0);'''if(sensorValue'>'0)'''{'''''''Serial.println(sensorValue);'''}'''delay(1000);'''}

Arduino Programming

void'setup()'{'''//a'comment'in'the'setup'section'which'is'run'once'''Serial.begin(9600);}

void'loop()'{'''//a'comment'in'the'loop'section,'which'is'looped'forever'''int'sensorValue'='analogRead(A0);'''if(sensorValue'>'0)'''{'''''''Serial.println(sensorValue);'''}'''delay(1000);'''}

Arduino Programming

void'setup()'{'''//a'comment'in'the'setup'section'which'is'run'once'''Serial.begin(9600);}

void'loop()'{'''//a'comment'in'the'loop'section,'which'is'looped'forever'''int'sensorValue'='analogRead(A0);'''if(sensorValue'>'0)'''{'''''''Serial.println(sensorValue);'''}'''delay(1000);'''}

Arduino Programming

Sensors

Hands-on!

#define'PHOTOSENSE_ANA_PIN'A0''

void'setup()'{'''//a'comment'in'the'setup'section'which'is'run'once'''Serial.begin(9600);}

void'loop()'{'''int'microphoneValue'='analogRead(PHOTOSENSE_ANA_PIN);'''Serial.print("Sensor'Value:'");'''Serial.println(microphoneValue);'''delay(1000);'''}