1 / 25

Intro to Raspberry Pi Brad Luyster BradLuyster@gmail

Intro to Raspberry Pi Brad Luyster BradLuyster@gmail.com. Before We Start. Windows Users Go to http://files.lvl1.org from your web browser Navigate to “Raspberry Pi Boot Camp” Download all the files, then Install RealTerm, Win32DiskImager and Putty (Keep the .img file for later)

iokina
Download Presentation

Intro to Raspberry Pi Brad Luyster BradLuyster@gmail

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intro to Raspberry Pi Brad Luyster BradLuyster@gmail.com

  2. Before We Start Windows Users Go to http://files.lvl1.org from your web browser Navigate to “Raspberry Pi Boot Camp” Download all the files, then Install RealTerm, Win32DiskImager and Putty (Keep the .img file for later) Linux/Mac Users Go to http://files.lvl1.org from your web browser Download “2013-07-26-wheezy-raspbian.img” Install Picocom (Or know how to use screen to open a serial port) Know how to use “dd” and “ssh”

  3. What is the Raspberry Pi? $35! Wow!

  4. Raspberry Pi I/O

  5. Raspberry Pi I/O http://elinux.org/RPi_Hardware http://elinux.org/RPi_VerifiedPeripherals http://elinux.org/Rpi_Low-level_peripherals

  6. Raspberry Pi I/O

  7. Raspberry Pi OS Raspberry Pi is a full blown computer Runs Linux Windows Licensing restrictions make that a non-starter You're going to learn how to use Linux, yay!

  8. Pi Project Inspiration

  9. Running your Pi Software Windows Win32DiskImager RealTerm Linux/Mac Picocom Hardware SD Card USB Cable Serial Adapter

  10. Pi OS Choices • Raspbian • ArchArm • PiDora

  11. Installing the Image Windows Extract Image file to SD Card using Win32DiskImager (Select Image file and SD Drive) Linux Use “dd bs=4M if=[IMAGE FILE] of=/dev/sd[DRIVE]” Be very careful to select the correct “of” drive.

  12. Connect the Serial Black to GND White to TXD Green to RXD RED IS DISCONNECTED

  13. Logging in to Pi Username is “pi” Password is “raspberry” You are now at a Linux Console

  14. Linux Console Basics “ls”: List files in the current directory “cd”: Change Directory “cp”: Copy File “mkdir”: Make Directory “nano”: Open Text File Editor

  15. Config On first boot, run “sudo raspi-config” Sudo – Super User Do Needed to do risky things on Linux Expand Filesystem is the most important thing to do here Reboot Afterward

  16. Hello World! • Grab and LED, and and a 560 ohm Resistor (Green, Blue, Brown) • Resistor to GND • Short LED leg to resistor • Long LED leg to #4

  17. Hello World • At the console, type “sudo python” and press enter to open python • “import RPi.GPIO as GPIO” to import the GPIO module • “GPIO.setmode(GPIO.BCM)” to set board pin numbering • “GPIO.setup(4, GPIO.OUT)” • “GPIO.output(4, GPIO.HIGH)” to turn LED on • “GPIO.output(4, GPIO.LOW)” to turn LED off

  18. More Advanced “Hello World” • import RPi.GPIO as GPIO • import time • GPIO.setmode(GPIO.BCM) • GPIO.setup(4, GPIO.OUT) • while(1): • GPIO.output(4, GPIO.HIGH) • time.sleep(1) • GPIO.output(4, GPIO.LOW) • time.sleep(1)

  19. Inputs Put switch in breadboard. Connect 10k resistor (Brown Black Red) between 3.3v and switch Connect other side of switch to GND Connect side with resistor to #17

  20. Polled Inputs import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUT) GPIO.setup(17, GPIO.IN) while(1): if GPIO.input(17) == GPIO.LOW: GPIO.output(4, GPIO.HIGH) else: GPIO.output(4, GPIO.LOW)

  21. Interrupt Inputs import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUT) GPIO.setup(17, GPIO.IN) def my_callback(channel): print("Switch Pressed!") GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback) while(1): pass

  22. Debounced Interrupts import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(4, GPIO.OUT) GPIO.setup(17, GPIO.IN) def my_callback(channel): print("Switch Pressed!") GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback, bouncetime=200) while(1): pass

  23. Networked Pi Plug in your network cable Type “ifconfig” to get network interface config Note the “inet addr” for “eth0”

  24. Networked Pi “sudo apt-get update” “sudo apt-get upgrade” Upgrades all software packages “sudo apt-get install [package]” to install new Try it now! “sudo apt-get install sl”

  25. Resources Buy a Pi Element14 RS Electronics *** MCM Electronics *** Buy Pi Stuff *** MCM Electronics *** Adafruit Learn Learn.adafruit.com Raspberrypi.org Elinux.org LVL1!

More Related