Raspberry Pi for Python Programmers Cookbook - Second Edition
eBook - ePub

Raspberry Pi for Python Programmers Cookbook - Second Edition

Tim Cox

Share book
  1. 510 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Raspberry Pi for Python Programmers Cookbook - Second Edition

Tim Cox

Book details
Book preview
Table of contents
Citations

About This Book

Over 60 recipes that harness the power of the Raspberry Pi together with Python programming and create enthralling and captivating projectsAbout This Bookā€¢ Install your first operating system, share files over the network, and run programs remotelyā€¢ Construct robots and interface with your own circuits and purpose built add-ons, as well as adapt off-the-shelf household devices using this pragmatic guideā€¢ Packed with clear, step-by-step recipes to walk you through the capabilities of Raspberry Pi Who This Book Is ForReaders are expected to be familiar with programming concepts and Python (where possible Python 3 is used), although beginners should manage with the help of a good Python reference book and background reading. No prior knowledge of the Raspberry Pi or electronics is required; however, for the hardware sections you will need some basic electronic components/household tools to build some of the projects.What You Will Learnā€¢ Get the Raspberry Pi set up and running for the first timeā€¢ Remotely connect to the Raspberry Pi and use your PC/laptop instead of a separate screen/keyboardā€¢ Get to grips with text, files and creating quick menus using Pythonā€¢ Develop desktop applications; handle images and process files with easeā€¢ Make use of graphics and user control to develop your own exciting gamesā€¢ Use the Raspberry Pi's powerful GPU to create 3D worldsā€¢ Take control of the real world and interface with physical hardware, combining hardware and software for your own needsā€¢ Measure and control processes, respond to real events and monitor through the Internetā€¢ Learn about the Raspberry Pi hardware inputs/outputs, starting with the basics and beyondā€¢ Expand the capabilities of the Raspberry Pi with hardware expansion / add-on modules (use analogue inputs, drive servos and motors, and use SPI/I2C)ā€¢ Create your own Pi-Rover or Pi-Hexpod driven by the Raspberry Piā€¢ Make use of existing hardware by modifying and interfacing with it using the Raspberry PiIn DetailRaspberry Pi cookbook for Python Programmers is a practical guide for getting the most out of this little computer. This book begins by guiding you through setting up the Raspberry Pi, performing tasks using Python 3 and introduces the first steps to interface with electronics. As you work through each chapter you will build up your skills and knowledge and apply them as you progress throughout the book, delving further and further into the unique abilities and features of the Raspberry Pi.Later, you will learn how to automate tasks by accessing files, build applications using the popular Tkinter library and create games by controlling graphics on screen. You will harness the power of the built-in graphics processor by using Pi3D to generate your own high quality 3D graphics and environments. Connect directly to the Raspberry Pi's hardware pins to control electronics from switching on LEDs and responding to push buttons right through to driving motors and servos. Learn how to monitor sensors to gather real life data and to use it to control other devices, and view the results over the Internet. Apply what you have learnt by creating your own Pi-Rover or Pi-Hexipod robots. Finally, we will explore using many of the purpose built add-ons available for the Raspberry Pi, as well as interfacing with common household devices in new ways.Style and approachWritten in a cookbook style, the book contains a series of recipes on various topics, ranging from simple to complex. It is an easy-to-follow and step-by-step guide with examples of various feature integration suitable for any search application.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Raspberry Pi for Python Programmers Cookbook - Second Edition an online PDF/ePUB?
Yes, you can access Raspberry Pi for Python Programmers Cookbook - Second Edition by Tim Cox in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785283901

Raspberry Pi for Python Programmers Cookbook - Second Edition


Table of Contents

Raspberry Pi for Python Programmers Cookbook - Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why Subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Safety and using electronics
Sections
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with a Raspberry Pi Computer
Introduction
Introducing the Raspberry Pi
What is with the name?
Why Python?
Python 2 and Python 3
Which version of Python should you use?
The Raspberry Pi family ā€“ a brief history of Pi
Which Pi to choose?
Connecting the Raspberry Pi
Getting ready
How to do itā€¦
There's moreā€¦
Secondary hardware connections
Using NOOBS to set up your Raspberry Pi SD card
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Changing the default user password
Ensuring that you shut down safely
Preparing an SD card manually
Expanding the system to fit in your SD card
Accessing the RECOVERY/BOOT partition
Using the tools to back up your SD card in case of failure
Networking and connecting your Raspberry Pi to the Internet via the LAN connector
Getting ready
How to do itā€¦
There's moreā€¦
Using built-in Wi-Fi and Bluetooth on the Raspberry Pi
Getting ready
How to do itā€¦
Connecting to your Wi-Fi network
Connecting to Bluetooth devices
Configuring your network manually
Getting ready
How to do itā€¦
There's moreā€¦
Networking directly to a laptop or computer
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Direct network link
See also
Networking and connecting your Raspberry Pi to the Internet via a USB Wi-Fi dongle
Getting ready
How to do itā€¦
There's moreā€¦
Using USB wired network adapters
Connecting to the Internet through a proxy server
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Connecting remotely to the Raspberry Pi over the network using VNC
Getting ready
How to do itā€¦
There's moreā€¦
Connecting remotely to the Raspberry Pi over the network using SSH (and X11 Forwarding)
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Running multiple programs with X11 Forwarding
Running as a desktop with X11 Forwarding
Running PyGame and Tkinter with X11 Forwarding
Sharing the home folder of the Raspberry Pi with SMB
Getting ready
How to do itā€¦
Keeping the Raspberry Pi up to date
Getting ready
How to do itā€¦
There's moreā€¦
2. Starting with Python Strings, Files, and Menus
Introduction
Working with text and strings
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Using files and handling errors
Getting ready
How to do itā€¦
How it worksā€¦
Creating a boot-up menu
How to do itā€¦
How it worksā€¦
There's moreā€¦
Creating a self-defining menu
How to do itā€¦
How it worksā€¦
There's moreā€¦
Alternative script locations
Adding scripts to PATH
3. Using Python for Automation and Productivity
Introduction
Using Tkinter to create graphical user interfaces
Getting ready
How to do itā€¦
How it worksā€¦
Creating a graphical application ā€“ Start menu
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Displaying photo information in an application
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Organizing your photos automatically
Getting ready
How to do itā€¦
How it worksā€¦
4. Creating Games and Graphics
Introduction
Using IDLE3 to debug your programs
How to do itā€¦
How it worksā€¦
Drawing lines using a mouse on Tkinter Canvas
Getting ready
How to do itā€¦
How it worksā€¦
Creating a bat and ball game
Getting ready
How to do itā€¦
How it worksā€¦
Creating an overhead scrolling game
Getting ready
How to do itā€¦
How it worksā€¦
5. Creating 3D Graphics
Introduction
Starting with 3D coordinates and vertices
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Camera
Shaders
Lights
Textures
Creating and importing 3D models
Getting ready
How to do itā€¦
How it works...
There's moreā€¦
Creating or loading your own objects
Changing the object's textures and .mtl files
Taking screenshots
Creating a 3D world to roam in
Getting ready
How to do itā€¦
How it worksā€¦
Building 3D maps and mazes
Getting ready
How to do itā€¦
How it works...
There's more...
The Building module
Using SolidObjects to detect collisions
6. Using Python to Drive Hardware
Introduction
Controlling an LED
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Controlling the GPIO current
Responding to a button
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Safe voltages
Pull-up and pull-down resistor circuits
Protection resistors
A controlled shutdown button
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Resetting and rebooting Raspberry Pi
Adding extra functions
The GPIO keypad input
Getting ready
How to do itā€¦
How it worksā€¦
There's moreā€¦
Generating other key combinations
Emulating mouse events
Multiplexed color LEDs
Getting ready
How to do itā€¦
How it worksā€¦
There's ...

Table of contents