200 likes | 355 Views
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
E N D
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 • Treasurer • Name • Term begins next school year
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?
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
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!
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
Raspberry Pi Sensor Project • Goals for today: • Editors • Intro to Python • Connect LED
Getting Started: Editors • nano • IDLE • Geany
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
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
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
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
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
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()
Using GPIO: Blinking LED Remove red wire Connect yellow wire from pin 11 to anode of LED (long lead)
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!’