Python programming with Raspberry Pi : build small yet powerful robots and automation systems with Raspberry Pi Zero /
Become a master of Python programming using the small yet powerful Raspberry Pi Zero About This Book This is the first book on the market that teaches Python programming with Raspberry Pi Zero Develop exciting applications such as a mobile robot and home automation controller using Python This step-...
Clasificación: | Libro Electrónico |
---|---|
Autores principales: | , |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Publishing,
2017.
|
Temas: | |
Acceso en línea: | Texto completo (Requiere registro previo con correo institucional) |
Tabla de Contenidos:
- Credits; About the Authors; About the Reviewer; www.PacktPub.com; Customer Feedback; Table of Contents; Preface; Chapter 1: Getting Started with Python and the Raspberry Pi Zero; Let's get started!; Things needed for this book; Buying the Raspberry Pi Zero; Introduction to the Raspberry Pi Zero; The features of the Raspberry Pi Zero; The setup of the Raspberry Pi Zero; Soldering the GPIO headers; Enclosure for the Raspberry Pi Zero; OS setup for the Raspberry Pi; micro SD card preparation; Let's learn Python!; The Hello World example; Setting up your Raspberry Pi Zero for Python programming.
- IDLE's interactive toolThe text editor approach; Launching the Python interpreter via the Linux Terminal; Executing Python scripts using the Linux Terminal; The print() function; The help() function; Summary; Chapter 2: Arithmetic Operations, Loops, and Blinky Lights; Hardware required for this chapter; Arithmetic operations; Bitwise operators in Python; Logical operators; Data types and variables in Python; Reading inputs from the user; The formatted string output; The str.format() method; An exercise for the reader; Another exercise for the reader; Concatenating strings; Loops in Python.
- A for loopIndentation; Nested loops; A while loop; Raspberry Pi's GPIO; Blinky lights; Code; The applications of GPIO control; Summary; Chapter 3: Conditional Statements, Functions, and Lists; Conditional statements; An if-else statement; if-elif-else statement; Breaking out of loops; The applications of conditional statements: executing tasks using GPIO; Breaking out a loop by counting button presses; Functions in Python; Passing arguments to a function:; Returning values from a function; The scope of variables in a function; GPIO callback functions; DC motor control in Python.
- Some mini-project challenges for the readerSummary; Chapter 4: Communication Interfaces; UART
- serial port; Raspberry Pi Zero's UART port; Setting up the Raspberry Pi Zero serial port; Example 1
- interfacing a carbon dioxide sensor to the Raspberry Pi; Python code for serial port communication; I2C communication; Example 2
- PiGlow; Installing libraries; Example; Example 3
- Sensorian add-on hardware for the Raspberry Pi; I2C drivers for the lux sensor; Challenge; The SPI interface; Example 4
- writing to external memory chip; Challenge to the reader; Summary.
- Chapter 5: Data Types and Object-Oriented Programming in PythonLists; Operations that could be performed on a list; Append element to list:; Remove element from list:; Retrieving the index of an element; Popping an element from the list; Counting the instances of an element:; Inserting element at a specific position:; Challenge to the reader; Extending a list; Clearing the elements of a list; Sorting the elements of a list; Reverse the order of elements in list; Create copies of a list; Accessing list elements; Accessing a set of elements within a list; List membership.