万本电子书0元读

万本电子书0元读

顶部广告

Raspberry Pi: Making Amazing Projects Right from Scratch!电子书

售       价:¥

6人正在读 | 0人评论 9.8

作       者:Ashwin Pajankar,Arush Kakkar,Matthew Poole

出  版  社:Packt Publishing

出版时间:2016-09-01

字       数:254.0万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Explore the powers of Raspberry Pi and build your very own projects right out of the box About This Book From robotics to gaming, this Learning Path will unlock your creativity! Build your own impressive IoT projects to transform your home Featuring some of Packt’s very best Raspberry Pi content, this Learning Path doesn’t just get you to your destination – it opens up a whole horizon of possibilities! Who This Book Is For Want new ideas for your next Raspberry Pi projectGot one lying around gathering dustThis Learning Path gets you straight into the creative dirty work of programming and playing with your pi. Whether your new to Raspberry Pi, or an experienced maker, we think this Learning Path will inspire you and get your creative juices flowing! What You Will Learn Discover an aweome range of Raspberry Pi projects Bridge the gap between software and hardware through your Pi and find out how to make an operating system interact with cameras and other hardware Find out how to use your Raspberry Pi for gaming Secure your home with this tiny computer! Make science fiction a reality – build a walking robot In Detail Looking for inspiration for your next Raspberry Pi projectNot sure where to beginThis Learning Path is the perfect place to begin, providing you with an accessible yet comprehensive journey through Raspberry Pi. Following three modules, you’ll soon be confident and prepared to get creative with your microcomputer. Raspberry Pi by Example is the first module in this Learning Path – and it does exactly what it says. It doesn’t just teach, it shows you how to go and build some awesome Raspberry Pi projects immediately. Build and play your own games with the Pi, build a complete Internet of Things home automation system that controls your house through Twitter… let your imagination run wild! In the next module we’ll look in more depth at building a home security system. You’ll be using some of the skills you devoped through the first module, but apply them to something more intricate and impressive. Using a Linux based operating system as the foundations, you’ll gradually build up an entire security infrastructure adding cameras, remote controls, and even intrusion alerts! In the final module, we’ll take you into the world of Raspberry Pi robotics. By the end of it, you’ll have built a biped robot that can interact with its environment! This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products: Raspberry Pi By Example by Ashwin Pajankar and Arush Kakkar Building a Home Security System with Raspberry Pi by Matthew Pole Raspberry Pi Robotics Essentials by Richard Grimmett Style and approach It’s not every day you build a home automation system. It’s not every day you build a walking robot. But with this Learning Path you’ll do just that. So get started and let this tiny computer expand your imagination.
目录展开

Raspberry Pi : Making Amazing Projects Right from Scratch!

Table of Contents

Raspberry Pi : Making Amazing Projects Right from Scratch!

Raspberry Pi : Making Amazing Projects Right from Scratch!

Credits

Preface

What this learning path covers

What you need for this learning path

Who this learning path is for

Reader feedback

Customer support

Downloading the example code

Errata

Piracy

Questions

1. Module 1

1. Introduction to Raspberry Pi and Python

Single-board computers

Raspberry Pi

Raspberry Pi models

Operating systems

Raspbian

Setting up the Raspberry Pi

Preparing MicroSD card manually

Booting up our Pi for the first time

Shutting down and rebooting Pi safely

Updating the Pi

Getting started with Python

Turtle programming with Python

Summary

2. Minecraft Pi

Introduction to Minecraft Pi

Playing Minecraft Pi

Movement control in Minecraft Pi

Action control in Minecraft Pi

Other controls in Minecraft Pi

Python programming for Minecraft Pi

Summary

3. Building Games with PyGame

Introducing PyGame

Installing PyGame

Drawing a binary fractal tree

Building a snake game

Summary

4. Working with a Webcam and Pi Camera

Working with webcams

Crontab

Creating a timelapse sequence using fswebcam

Webcam video recording and playback

Working with the Pi Camera and NoIR Camera modules

Using raspistill and raspivid

Using picamera in Python with the Pi Camera module

The Pi camera versus the webcam

Summary

5. Introduction to GPIO Programming

Introducing GPIO pins

Building an LED Blinker

Connecting a button

Installing PiGlow

Using PiGlow

Building a binary clock

Summary

6. Creating Animated Movies with Raspberry Pi

Introducing stop-motion animation

Setting up the prerequisites

Setting up and testing the camera

Adding the hardware button

Rendering the video

Summary

7. Introduction to Computer Vision

Introducing Computer Vision

Introducing OpenCV

Setting up Pi for Computer Vision

Testing the OpenCV installation with Python

Introducing NumPy

Array creation

Basic operations on arrays

Linear algebra

Working with images

Using matplotlib

Working with Webcam using OpenCV

Saving a video using OpenCV

Pi Camera and OpenCV

Retrieving image properties

Arithmetic operations on images

Splitting and merging image color channels

Negating an image

Logical operations on images

Colorspaces and conversions

Tracking in real time based on color

Summary

8. Creating Your Own Motion Detection and Tracking System

Thresholding images

Otsu's method

Noise

Kernels for noise removal

2D convolution filtering

Low pass filtering

Morphological transformations on images

Motion detection and tracking

Summary

9. Grove Sensors and the Raspberry Pi

Introducing the GrovePi

Setting up the GrovePi

Displaying the weather

Intruder detection system

Summary

10. Internet of Things with the Raspberry Pi

Introducing the Internet of Things

Installing the Twitter API for Python

Using Tweepy

Setting up a SQLite database in Python

Building a tweeting weather station

Adding speech capabilities to our weather station

Summary

11. Build Your Own Supercomputer with Raspberry Pi

Introducing a Pi-based supercomputer

Installing and configuring MPICH2 and MPI4PY

Installing the MPICH library

Installing MPI4PY

Setting up the Raspberry Pi cluster

Setting up SSH access from the host to the client

Running code in parallel

Performance benchmarking of the cluster

Introducing N-Body simulations

Installing and running GalaxSee

Summary

12. Advanced Networking with Raspberry Pi

Introducing DHCP

A few networking concepts

Configuring a Raspberry Pi to act as a DHCP server

Introducing Domain Naming System (DNS)

Setting up a DNS server on the Pi

Configuring the setup for a web server

Automating node discovery in a network

Summary

13. Setting Up a Web Server on the Raspberry Pi

Introducing and installing Apache on Raspbian

Installing PHP and MySQL

Installing WordPress

Configuring the WordPress installation

Summary

14. Network Programming in Python with the Pi

The basics of sockets

The difference between TCP and UDP

The architecture and programming of UDP sockets

Sending and receiving data with UDP

UDP servers and NCAT

An echo server using Python UDP sockets

A UDP client

The architecture of TCP sockets

Creating a TCP socket

Connecting to a server with a TCP socket

Receiving data from the server

Programming socket servers

Binding a socket

Listening for incoming connections

Handling multiple connections

Looking back

A Telnet client in Python

A chat program

The chat server

The chat client

References

Exercise

Summary

15. Newer Raspberry Pi Models

The Raspberry Pi Zero

The Raspberry Pi 3

2. Module 2

1. Setting Up Your Raspberry Pi

Which flavor of Pi?

Raspberry Pi Model A

Raspberry Pi Model B

Raspberry Pi Model B+ and Model 2

Model comparison table

So which one?

Preparing the SD card

Downloading the Raspbian image

Using Microsoft Windows

Using Linux

Booting your Pi

Expanding the file system

Using the raspi-config utility

Setting up your Pi

Getting up to date

Getting the right time

fake-hwclock

ntp

Talking of security–

What is this sudo thing anyway?

Connecting via Wi-Fi

Summary

2. Connecting Things to Your Pi with GPIO

Prerequisites

Say hello to the GPIO

Digital I/O pins

The I2C bus

The SPI bus

The UART serial bus

USB ports

Power connections

Getting acquainted with the GPIO

Let there be light

Getting flashy–

Adding a switch

Pulling yourself together

The detection script

The most elaborate light switch in the world

The illuminating script

Summary

3. Extending Your Pi to Connect More Things

Prerequisites

The I2C bus

Just 2 wires

What's your address?

There is a parallel universe

Serial-to-parallel conversion

Give me power

Building an I2C expander

The I2C port expander circuit

Let's walk through the circuit

Building your expansion board

Using ready-made expansion boards

Hobbytronics MCP23017 expander port kit

PiFace Digital I/O expansion board

Gertboard

Summary

4. Adding a Magnetic Contact Sensor

Prerequisites

The working of magnetic contact sensors

Setting up the I2C port expander

Enabling the I2C Bus

Installing the I2C tools package

Finding our devices

Setting up the port expander

Connecting our magnetic contact sensor

Monitoring the sensor

Anti-tamper circuits

Getting into the zone

Summary

5. Adding a Passive Infrared Motion Sensor

Prerequisites

Passive infrared sensors explained

Setting up your PIR sensor

Give me power (again)

Connecting our PIR motion sensor

12V alarm zone circuits

Alarm circuit protection

How it works

Wireless PIR motion sensors

433-MHz wireless alarm systems

Connecting a 433-MHz receiver

The alternative approach (because we have no choice)

The receiver wiring diagram

Logging detection data

Summary

6. Adding Cameras to Our Security System

Prerequisites

The Raspberry Pi camera module

Connecting the camera module

Setting up the camera module

Testing the camera module

Be a video star

Caught on camera

You have new mail

Setting up the e-mail sender client

Sending attachments

Where was that taken?

Night vision

An illuminating experience

The Elaborate light switch re-visited

Is that a badger?

Using USB cameras

Installing the webcam

Taking a snap

Snap snap snap

The multicamera setup

The Slave driver

Summary

7. Building a Web-Based Control Panel

Installing the web server

Testing the PHP5 installation

Being in control

Arming yourself

The master configuration file

Creating the web page

The control panel HTML template

Giving it some style

Making it dynamic

Getting a bit of help first

The main PHP code

I'm someone else

Remote access to our control panel

Setting up a dynamic DNS account

The Raspberry Pi dynamic DNS client

Setting up a static IP on your Raspberry Pi

Port-forwarding

Summary

8. A Miscellany of Things

Arming and disarming the system

Driving inductive loads

Beyond intrusion

A simple water detector

How it works

A simple temperature sensor

How it works

A carbon monoxide detector

Remote administration for our Raspberry Pi

Getting Webmin

Updating the repository sources

Importing the signing key

Accessing Webmin locally

Remotely accessing Webmin

Summary

9. Putting It All Together

Alarm system diagram

Overview of the system elements

A +12V power supply

A +3.3V power supply

The opto-isolator input module

The port expander

An arm/disarm switch

Alarm outputs

Designing the control scripts

Building the control script

Exploring the script code

Declarations

Updating config settings

Setting up the GPIO

Setting up the I2C port expander

Decoding the zone inputs status

Initialization

The system monitoring loop

Arming the system

Monitoring the zones

Entry delay

Sounding the main alarm

Disarming and resetting the system

We're done (almost)–

Automatically starting the system

Preserving the SD card

Creating a RAM-based file system

Conclusion

Tips for building systems

Summary

3. Module 3

1. Configuring and Programming Raspberry Pi

Configuring Raspberry Pi – the brain of your robot

Installing the operating system

Adding a remote graphical user interface

Establishing wireless access

Programming on Raspberry Pi

Creating and running Python programs on the Raspberry Pi

An introduction to the C/C++ programming language

Summary

2. Building the Biped

Building robots that can walk

How servo motors work

Building the biped platform

Using a servo controller to control the servos

Communicating with the servo controller with a PC

Connecting the servo controller to the Raspberry Pi

Creating a program to control your biped

Summary

3. Motion for the Biped

A basic stable pose

A basic walking motion

A basic turn for the robot

Summary

4. Avoiding Obstacles Using Sensors

Connecting Raspberry Pi to an infrared sensor

Connecting Raspberry Pi to a USB sonar sensor

Summary

5. Path Planning and Your Biped

Connecting a digital compass to the Raspberry Pi

Accessing the compass programmatically

Dynamic path planning for your robot

Basic path planning

Avoiding obstacles

Summary

6. Adding Vision to Your Biped

Installing a camera on your biped robot

Installing a USB camera on Raspberry Pi

Installing RaspiCam on Raspberry Pi

Downloading and installing OpenCV – a fully featured vision library

Edge Detection and OpenCv

Color and motion finding

Summary

7. Accessing Your Biped Remotely

Adding a wireless dongle and creating an access point

Adding a joystick remote control

Adding the capability to see remotely

Summary

A. Bibliography

Index

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部