P&O Session 2

627 views

Published on

Probleemoplossen en Ontwerpen slides.

Course at KU Leuven 2nd year engineering science students

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
627
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

P&O Session 2

  1. 1. PenO3 Sessie 2 Erik Duval Sven Charleer - Jose Luis Santos - Nick Vannieuwenhoven
  2. 2. 14.00: Arduino to Pi 14.20: Hands-on 15.40: Break 16.40: More hands-on 18.00: Done
  3. 3. Blogs: source code! Wiki: Backlog and team members!
  4. 4. Previous session Raspberry Pi ArduinoSensor LEDa a
  5. 5. Today Raspberry Pi ArduinoSensor LEDa a 6
  6. 6. Hook up sensors to Arduino (test on pc)
  7. 7. Plug Arduino into Pi (hub) Hook up sensors to Arduino (test on pc)
  8. 8. Plug Arduino into Pi (hub) Boot Pi Hook up sensors to Arduino (test on pc)
  9. 9. /dev/serial/by-id/usb-Gravitech_ARDUINO_NANO_13BP1184-if00-port0 Devices on Linux
  10. 10. /dev/serial/by-id/usb-Gravitech_ARDUINO_NANO_13BP1184-if00-port0 Devices on Linux
  11. 11. /dev/serial/by-id/usb-Gravitech_ARDUINO_NANO_13BP1184-if00-port0 Devices on Linux
  12. 12. /dev/serial/by-id/usb-Gravitech_ARDUINO_NANO_13BP1184-if00-port0 sudo ln -s /dev/arduino Devices on Linux
  13. 13. /dev/serial/by-id/usb-Gravitech_ARDUINO_NANO_13BP1184-if00-port0 Python & Arduino
  14. 14. https://pypi.python.org/pypi/pyserial Python & Arduino
  15. 15. https://pypi.python.org/pypi/pyserial Python & Arduino sudo python setup.py install TAR -XF
  16. 16. import  serial arduino  =  serial.Serial('/dev/arduino',  9600) while  True:          value  =  arduino.readline()          print(value) Python & Arduino
  17. 17. Excercise
  18. 18. #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);       } import  serial arduino  =  serial.Serial('/dev/arduino',  9600) while  True:          value  =  arduino.readline()          print(value)
  19. 19. Let’s go to the wiki

×