SlideShare a Scribd company logo
RMOUG QUARTERLY
EDUCATION WORKSHOP
Family Coding Day, August 7th, 2015
Elitch Gardens, Denver, CO
HARDWARE REQUIRED
 Raspberry Pi, (any version)
 Pibrella board, (this can be done without, but
requires the motor to be wired directly to the pi,
which is definitely not as easy… )
 Accessories- monitor, keyboard, mouse and
power supplies
HOOKUP AND STARTUP YOUR RASPBERRY
PI
 Ensure the Pibrella is already installed, if not,
the next slide will cover and handouts are
available from Kellyn.
 YOU MUST protect your HDMI port from the
Pibrella board. If you don’t have a buffer,
(cardboard, foam, etc.) between the two, cut out a
piece of cardboard or similar to stick between the
metal contacts on the bottom of the pibrella
board and the top of your HDMI port.
INSTALL PIBRELLA, (IF NOT DONE)
https://pypi.python.org/pypi/Pibrella
ART PROJECT TODAY
 Using a LIGHT art project, we’ll attach
the small item to a motor and control it
code.
 Can be a character that will dance in
circles, or animal/flower that spins.
 A flyer that will be launched
 The art must attach to a small wooden
“toothpick” or a flat stand.
 What you create is UP TO YOU!
THIS PROJECT WILL WORK WITH DIFFERENT
VERSIONS OF PYTHON…BUT
 Python3 will allow you to utilize all features of
the Pibrella.
Connected to the wifi, install this libraries and
then re-install the pibrella with new lib files:
>sudo apt-get install python3-pip
>sudo pip-3.2 install pibrella
AGAIN- THE GOAL OF TODAY’S
PROJECT
Create a Rotating Project of YOUR OWN design
with code-
 Using a simple motor and provided supplies.
 Be creative and build what you want that will
attach to a base or wooden stick.
 Think about the different uses for this project.
 Think about enhancements for your project while
you’re working with it!
ENTER TIMING FIRST!
Once the wheel and motors have been assembled
and attached to the Pibrella, it is time to program
them to do what they were built for... turning!
On your Raspberry Pi:
Open a terminal window and type vi
<file_name>.py and press Enter on the
keyboard. This will open a blank text editor file
in which you can type your code.
IMPORT THE LIBRARIES
 Begin your code by importing the Pibrella Python
library needed to control the motor by typing:
import pibrella
 Underneath, import the time library in the same
way so that you can add time delays to your
program:
import time
CODING AFTER TIME ENTRY
 Leave a blank line of code by pressing Enter.
 Underneath, you can now write the sequence of
instructions to control the attached motor:
pibrella.output.e.on() time.sleep(10)
pibrella.output.e.off()
To exit out of the program, type in:
quit()
 Press Esc :wq to save and quit.
CODE SHOULD LOOK LIKE THIS
import pibrella
import time
<enter break line in code>
pibrella.output.e.on() #turn on
time.sleep(10) #spin for 10sec
pibrella.output.e.off() #turn off
quit()
HOOK UP YOUR ENGINE TO THE PIBRELLA
 Your Setup should
look like the
following:
 Wires red to
posistive, black to
negative.
 Most likely hooked
up to D, but could
be to E, (top right
of red button for a
few)
ATTACH YOUR ART PROJECT AND RUN
 Now that you tested successfully, add your art
project with whatever type base to the motor and
run again.
RUN THE CODE
 Python
sudo python –i <file name>.py
 Python 3
sudo python3 <file name>.py
Now this just runs the engine as soon
as you execute it and no control
outside of that.
MORE ADVANCED BUTTON CONTROL
import pibrella
import time
<line break in code>
while true:
<4 spcs>if pibrella.button.read():
<indent 8 spcs> pibrella.output.e.on()
<indent 8 spcs> time.sleep(0.01)
<indent 8 spcs> pibrella.output.e.off()
<indent 8 spcs> pibrella.output.e.on()
<indent 8 spcs> time.sleep(0.02)
<indent 8 spcs> pibrella.output.e.off()
<indent 8 spcs> break
Save File
RUN THE CODE
 Python
sudo python –i <file name>.py
 Python 3
sudo python3 <file name>.py
NOW, push the button to execute the
spin!
How did you spin timing and motor power
combination do?
Do you need to add or subtract time to your
project?
LAUNCHING “FLYERS”
 Attach your Flyer, (spinner or other design) to
your engine.
 Ensure it’s stable enough to spin, but not too
tight that it won’t launch.
CODE THE FOLLOWING
import pibrella
import time
<line break in code>
while true:
<4 spcs>if pibrella.button.read():
<indent 8 spcs> pibrella.output.e.on()
<indent 8 spcs> time.sleep(30)
<indent 8 spcs> pibrella.output.e.off()
<indent 8 spcs> break
quit()
Save File with name “launch_flyer.py”
RUN THE CODE
 Python
sudo python –i launch_flyer.py
 Python 3
sudo python3 launch_flyer.py
The current time for the spin is 30 seconds-
Is this too much? Does the engine spin long after
the flyer has launched and you need to decrease
it?
Is it not long enough? Increase the time from
time.sleep(30) to time.sleep(45) to see if that is
enough.
ENHANCING YOUR PROJECT
 How would you build out your project?
 What kind of additional coding would you add?
 Would your project be cooler if you added:
Sound?
Light?
Additional Motors?
Art?
HAVE QUESTIONS?

More Related Content

What's hot

Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino
Giuseppe Modarelli
 

What's hot (10)

Automated monitoring with NSClient++ and Icinga
Automated monitoring with NSClient++ and IcingaAutomated monitoring with NSClient++ and Icinga
Automated monitoring with NSClient++ and Icinga
 
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP ChainsExploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
Exploit Research and Development Megaprimer: DEP Bypassing with ROP Chains
 
Aio...whatever
Aio...whateverAio...whatever
Aio...whatever
 
Refactorización de aplicaciones PHP/Symfony2
Refactorización de aplicaciones PHP/Symfony2Refactorización de aplicaciones PHP/Symfony2
Refactorización de aplicaciones PHP/Symfony2
 
Html5 game, websocket e arduino
Html5 game, websocket e arduino Html5 game, websocket e arduino
Html5 game, websocket e arduino
 
What's new in Perl 5.10?
What's new in Perl 5.10?What's new in Perl 5.10?
What's new in Perl 5.10?
 
CodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHPCodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHP
 
xyz
xyzxyz
xyz
 
PHP Generators
PHP GeneratorsPHP Generators
PHP Generators
 
Hackathon Taiwan 5th : Arduino 101
Hackathon Taiwan  5th : Arduino 101 Hackathon Taiwan  5th : Arduino 101
Hackathon Taiwan 5th : Arduino 101
 

Viewers also liked

Smart Mirror Summer Report
Smart Mirror Summer ReportSmart Mirror Summer Report
Smart Mirror Summer Report
Jabari Barton
 

Viewers also liked (10)

Maker printouts
Maker printoutsMaker printouts
Maker printouts
 
Raspberry pi why and what to buy
Raspberry pi why and what to buyRaspberry pi why and what to buy
Raspberry pi why and what to buy
 
Magic Mirror Functions
Magic Mirror FunctionsMagic Mirror Functions
Magic Mirror Functions
 
Magic Mirror
Magic MirrorMagic Mirror
Magic Mirror
 
Sketch and the Magic Mirror
Sketch and the Magic MirrorSketch and the Magic Mirror
Sketch and the Magic Mirror
 
Magic Mirror for Wedding Boutiques
Magic Mirror for Wedding BoutiquesMagic Mirror for Wedding Boutiques
Magic Mirror for Wedding Boutiques
 
Magic Mirror for Retail Stores
Magic Mirror for Retail StoresMagic Mirror for Retail Stores
Magic Mirror for Retail Stores
 
IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3IOT Based Home Automation using Raspberry Pi-3
IOT Based Home Automation using Raspberry Pi-3
 
Smart Mirror Summer Report
Smart Mirror Summer ReportSmart Mirror Summer Report
Smart Mirror Summer Report
 
Smart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PISmart Wireless Surveillance Monitoring using RASPBERRY PI
Smart Wireless Surveillance Monitoring using RASPBERRY PI
 

Similar to RMOUG QEW Family Coding Event- Raspberry PI

amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdfamrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapalibuildersreviews
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi board
Thierry Gayet
 

Similar to RMOUG QEW Family Coding Event- Raspberry PI (20)

Raspberry Pi Introductory Lecture
Raspberry Pi Introductory LectureRaspberry Pi Introductory Lecture
Raspberry Pi Introductory Lecture
 
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdfamrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
amrapali builders @@ hardware hacking and robotics using the raspberry pi.pdf
 
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi [Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
[Forward4 Webinar 2016] Building IoT Prototypes w/ Raspberry Pi
 
Using arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of thingsUsing arduino and raspberry pi for internet of things
Using arduino and raspberry pi for internet of things
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
 
Raspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projectsRaspberry pi pico projects raspberry pi projects
Raspberry pi pico projects raspberry pi projects
 
pcDuino Presentation at SparkFun
pcDuino Presentation at SparkFunpcDuino Presentation at SparkFun
pcDuino Presentation at SparkFun
 
Intro to the raspberry pi board
Intro to the raspberry pi boardIntro to the raspberry pi board
Intro to the raspberry pi board
 
Artificial Intelligence Neural Processing Unit Hikey970
Artificial Intelligence Neural Processing Unit Hikey970Artificial Intelligence Neural Processing Unit Hikey970
Artificial Intelligence Neural Processing Unit Hikey970
 
Controlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using PythonControlling Raspberry Pis With Your Phone Using Python
Controlling Raspberry Pis With Your Phone Using Python
 
DeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel EdisonDeviceHub - First steps using Intel Edison
DeviceHub - First steps using Intel Edison
 
Raspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your LibraryRaspberry Pi - Unlocking New Ideas for Your Library
Raspberry Pi - Unlocking New Ideas for Your Library
 
Introduction to pi
Introduction to piIntroduction to pi
Introduction to pi
 
Introduction to IPython & Notebook
Introduction to IPython & NotebookIntroduction to IPython & Notebook
Introduction to IPython & Notebook
 
Introduction to pcDuino
Introduction to pcDuinoIntroduction to pcDuino
Introduction to pcDuino
 
Getting Started with Embedded Python: MicroPython and CircuitPython
Getting Started with Embedded Python: MicroPython and CircuitPythonGetting Started with Embedded Python: MicroPython and CircuitPython
Getting Started with Embedded Python: MicroPython and CircuitPython
 
Meng
MengMeng
Meng
 
Meng
MengMeng
Meng
 
Raspberry Pi Using Python
Raspberry Pi Using PythonRaspberry Pi Using Python
Raspberry Pi Using Python
 
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdfAdvanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
Advanced View of Projects Raspberry Pi List - Raspberry PI Projects.pdf
 

More from Kellyn Pot'Vin-Gorman

More from Kellyn Pot'Vin-Gorman (20)

Redgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptxRedgate_summit_atl_kgorman_intersection.pptx
Redgate_summit_atl_kgorman_intersection.pptx
 
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptxSQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
SQLSatOregon_kgorman_keynote_NIAIMLEC.pptx
 
Boston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptxBoston_sql_kegorman_highIO.pptx
Boston_sql_kegorman_highIO.pptx
 
Oracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 UpdateOracle on Azure IaaS 2023 Update
Oracle on Azure IaaS 2023 Update
 
IaaS for DBAs in Azure
IaaS for DBAs in AzureIaaS for DBAs in Azure
IaaS for DBAs in Azure
 
Being Successful with ADHD
Being Successful with ADHDBeing Successful with ADHD
Being Successful with ADHD
 
Azure DBA with IaaS
Azure DBA with IaaSAzure DBA with IaaS
Azure DBA with IaaS
 
Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"Turning ADHD into "Awesome Dynamic Highly Dependable"
Turning ADHD into "Awesome Dynamic Highly Dependable"
 
PASS Summit 2020
PASS Summit 2020PASS Summit 2020
PASS Summit 2020
 
DevOps in Silos
DevOps in SilosDevOps in Silos
DevOps in Silos
 
Azure Databases with IaaS
Azure Databases with IaaSAzure Databases with IaaS
Azure Databases with IaaS
 
How to Win When Migrating to Azure
How to Win When Migrating to AzureHow to Win When Migrating to Azure
How to Win When Migrating to Azure
 
Securing Power BI Data
Securing Power BI DataSecuring Power BI Data
Securing Power BI Data
 
Cepta The Future of Data with Power BI
Cepta The Future of Data with Power BICepta The Future of Data with Power BI
Cepta The Future of Data with Power BI
 
Pass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft ProfessionalPass Summit Linux Scripting for the Microsoft Professional
Pass Summit Linux Scripting for the Microsoft Professional
 
Taming the shrew Power BI
Taming the shrew Power BITaming the shrew Power BI
Taming the shrew Power BI
 
PASS 24HOP Linux Scripting Tips and Tricks
PASS 24HOP Linux Scripting Tips and TricksPASS 24HOP Linux Scripting Tips and Tricks
PASS 24HOP Linux Scripting Tips and Tricks
 
Power BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle CloudPower BI with Essbase in the Oracle Cloud
Power BI with Essbase in the Oracle Cloud
 
ODTUG Leadership Talk- WIT and Sponsorship
ODTUG Leadership Talk-  WIT and SponsorshipODTUG Leadership Talk-  WIT and Sponsorship
ODTUG Leadership Talk- WIT and Sponsorship
 
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys  How to Build a Successful Microsoft DevOps Including the DataDevOps and Decoys  How to Build a Successful Microsoft DevOps Including the Data
DevOps and Decoys How to Build a Successful Microsoft DevOps Including the Data
 

Recently uploaded

Recently uploaded (20)

IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
The architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdfThe architecture of Generative AI for enterprises.pdf
The architecture of Generative AI for enterprises.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 

RMOUG QEW Family Coding Event- Raspberry PI

  • 1. RMOUG QUARTERLY EDUCATION WORKSHOP Family Coding Day, August 7th, 2015 Elitch Gardens, Denver, CO
  • 2. HARDWARE REQUIRED  Raspberry Pi, (any version)  Pibrella board, (this can be done without, but requires the motor to be wired directly to the pi, which is definitely not as easy… )  Accessories- monitor, keyboard, mouse and power supplies
  • 3. HOOKUP AND STARTUP YOUR RASPBERRY PI  Ensure the Pibrella is already installed, if not, the next slide will cover and handouts are available from Kellyn.  YOU MUST protect your HDMI port from the Pibrella board. If you don’t have a buffer, (cardboard, foam, etc.) between the two, cut out a piece of cardboard or similar to stick between the metal contacts on the bottom of the pibrella board and the top of your HDMI port.
  • 4. INSTALL PIBRELLA, (IF NOT DONE) https://pypi.python.org/pypi/Pibrella
  • 5. ART PROJECT TODAY  Using a LIGHT art project, we’ll attach the small item to a motor and control it code.  Can be a character that will dance in circles, or animal/flower that spins.  A flyer that will be launched  The art must attach to a small wooden “toothpick” or a flat stand.  What you create is UP TO YOU!
  • 6. THIS PROJECT WILL WORK WITH DIFFERENT VERSIONS OF PYTHON…BUT  Python3 will allow you to utilize all features of the Pibrella. Connected to the wifi, install this libraries and then re-install the pibrella with new lib files: >sudo apt-get install python3-pip >sudo pip-3.2 install pibrella
  • 7. AGAIN- THE GOAL OF TODAY’S PROJECT Create a Rotating Project of YOUR OWN design with code-  Using a simple motor and provided supplies.  Be creative and build what you want that will attach to a base or wooden stick.  Think about the different uses for this project.  Think about enhancements for your project while you’re working with it!
  • 8. ENTER TIMING FIRST! Once the wheel and motors have been assembled and attached to the Pibrella, it is time to program them to do what they were built for... turning! On your Raspberry Pi: Open a terminal window and type vi <file_name>.py and press Enter on the keyboard. This will open a blank text editor file in which you can type your code.
  • 9. IMPORT THE LIBRARIES  Begin your code by importing the Pibrella Python library needed to control the motor by typing: import pibrella  Underneath, import the time library in the same way so that you can add time delays to your program: import time
  • 10. CODING AFTER TIME ENTRY  Leave a blank line of code by pressing Enter.  Underneath, you can now write the sequence of instructions to control the attached motor: pibrella.output.e.on() time.sleep(10) pibrella.output.e.off() To exit out of the program, type in: quit()  Press Esc :wq to save and quit.
  • 11. CODE SHOULD LOOK LIKE THIS import pibrella import time <enter break line in code> pibrella.output.e.on() #turn on time.sleep(10) #spin for 10sec pibrella.output.e.off() #turn off quit()
  • 12. HOOK UP YOUR ENGINE TO THE PIBRELLA  Your Setup should look like the following:  Wires red to posistive, black to negative.  Most likely hooked up to D, but could be to E, (top right of red button for a few)
  • 13. ATTACH YOUR ART PROJECT AND RUN  Now that you tested successfully, add your art project with whatever type base to the motor and run again.
  • 14. RUN THE CODE  Python sudo python –i <file name>.py  Python 3 sudo python3 <file name>.py Now this just runs the engine as soon as you execute it and no control outside of that.
  • 15. MORE ADVANCED BUTTON CONTROL import pibrella import time <line break in code> while true: <4 spcs>if pibrella.button.read(): <indent 8 spcs> pibrella.output.e.on() <indent 8 spcs> time.sleep(0.01) <indent 8 spcs> pibrella.output.e.off() <indent 8 spcs> pibrella.output.e.on() <indent 8 spcs> time.sleep(0.02) <indent 8 spcs> pibrella.output.e.off() <indent 8 spcs> break Save File
  • 16. RUN THE CODE  Python sudo python –i <file name>.py  Python 3 sudo python3 <file name>.py NOW, push the button to execute the spin! How did you spin timing and motor power combination do? Do you need to add or subtract time to your project?
  • 17. LAUNCHING “FLYERS”  Attach your Flyer, (spinner or other design) to your engine.  Ensure it’s stable enough to spin, but not too tight that it won’t launch.
  • 18. CODE THE FOLLOWING import pibrella import time <line break in code> while true: <4 spcs>if pibrella.button.read(): <indent 8 spcs> pibrella.output.e.on() <indent 8 spcs> time.sleep(30) <indent 8 spcs> pibrella.output.e.off() <indent 8 spcs> break quit() Save File with name “launch_flyer.py”
  • 19. RUN THE CODE  Python sudo python –i launch_flyer.py  Python 3 sudo python3 launch_flyer.py The current time for the spin is 30 seconds- Is this too much? Does the engine spin long after the flyer has launched and you need to decrease it? Is it not long enough? Increase the time from time.sleep(30) to time.sleep(45) to see if that is enough.
  • 20. ENHANCING YOUR PROJECT  How would you build out your project?  What kind of additional coding would you add?  Would your project be cooler if you added: Sound? Light? Additional Motors? Art?