1 / 20

V2013.14

V2013.14. Agenda. Old Business Executive Committee LCCUG meeting volunteer(s) Reward Points Program New Business Weekly Quiz Updated Website Raspberry Pi Sensor Project Intro to Python LED. Executive Committee. President Name Vice President Name Communications Director Name

feryal
Download Presentation

V2013.14

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. V2013.14

  2. Agenda • Old Business • Executive Committee • LCCUG meeting volunteer(s) • Reward Points Program • New Business • Weekly Quiz • Updated Website • Raspberry Pi Sensor Project • Intro to Python • LED

  3. Executive Committee • President • Name • Vice President • Name • Communications Director • Name • Treasurer • Name • Term begins next school year

  4. Lorain County Computer User Group • Website: www.lccug.com • Established around 1990 • The majority of their members are retired • Have a variety of knowledge and skills • June 10th Meeting: 6:00 – 7:30PM • Present on a topic of our choice • Volunteers?

  5. Avon Library Explorers Program • June 24th at the Avon Public Library • Mini Explorers (Pre K - Kindergarten) • 12:30-1:30 PM • Explorers (1st - 5th Grade) • 2:00 -3:00 PM • Theme is “Fun with Robotics” • Game/activity/experiment that will be engaging, but not too advanced for respective age groups • Any kid-friendly games or activities that we want to develop would be perfect No longer needed

  6. Weekly Quiz • What command should you use to immediately & gracefully shutdown and halt the Raspberry Pi? • sudo shutdown –h now • What command would you use to find the amount of free memory? • free -h • Which command shows a list of commands you recently typed? • history • What command would you use to reconfigure the Raspberry Pi? • sudoraspi-config • What Raspberry Pi feature will we use to communicate with off-board sensors? • GPIO • No perfect scores!

  7. Reward Points Program • Earn reward points for: • Completing surveys, polls, etc. • Completing weekly tasks • Completing projects • Participate during meetings • Volunteer opportunities • Redeem points for: • Tech Club gear • Other prizes • Create reward levels

  8. Raspberry Pi Sensor Project • Goals for today: • Editors • Intro to Python • Connect LED

  9. Getting Started: Editors • nano • IDLE • Geany

  10. Our First Python Program • Create the hellopi.py file using nano as follows: nano -c hellopi.py • Within our hellopi.py file, add the following code: #!/usr/bin/python #hellopi.py print ("Hello Raspberry Pi") • When done, save and exit (Ctrl + X, Y, and Enter) • To run the file, use the following command: python hellopi.py

  11. Challenges for Reward Points • Change “Hello Raspberry Pi” text to red • Show CPU speed or Temperature • Add ‘LED on/LED off’ to blink code • Have the on/off message coincide with LED • See website code samples for guidance

  12. Using GPIO: Raspberry Pi Pinout

  13. Using GPIO: Power a LED Resistor connects between Ground and LED cathode (short lead) Connect jumper from 3.3v to LED anode (long lead) Connect black wire to Ground, pin 6 Connect red wire to 3.3v, pin 1

  14. Using GPIO: Code to Blink LED #!/usr/bin/env python # Must be run as root: sudo python blink11led.py # Import necessary modules # Provides various time-related functions import time # Control Raspberry Pi GPIO channels import RPi.GPIO as GPIO

  15. Using GPIO: Code to Blink LED # Blinking function, turns LED on/off defblink(pin): # Turn LED on GPIO.output(pin, GPIO.HIGH) # Pause for 1 second time.sleep(1) # Turn LED off GPIO.output(pin, GPIO.LOW) # Pause for 1 second time.sleep(1) return

  16. Using GPIO: Code to Blink LED # Use Raspberry Pi board pin numbers GPIO.setmode(GPIO.BOARD) # Set the output channel/pin GPIO.setup(11, GPIO.OUT) # Blink LED 10 times for i in range(0,10): blink(11) # Reset any GPIO pins when you exit the program GPIO.cleanup()

  17. Using GPIO: Blinking LED Remove red wire Connect yellow wire from pin 11 to anode of LED (long lead)

  18. More Python Fun • Code samples: • Add colors to terminal • Get system information • See our webpage under ‘Raspberry Pi Workshop’ • Look for ‘additional Python examples to try!’

  19. Backup Slides

  20. How do Python Programs Run?

More Related