Learning Python with Raspberry Pi

for electronic engineers

Dogan Ibrahim

Contents

  1. Preface
  2. Chapter 1: Raspberry Pi 4
    1. 1.1 Overview
    2. 1.2 Parts of the Raspberry Pi 4
    3. 1.3 Requirements of the Raspberry Pi 4
    4. 1.3.1 Setup Option 1
    5. 1.3.2 Setup Option 2
    6. 1.4 Summary
  3. Chapter 2: Setting Up the Raspberry Pi 4
    1. 2.1 Overview
    2. 2.2 Installation Steps
    3. 2.3 Powering Up your Raspberry Pi 4
    4. 2.4 Remote Access
    5. 2.4.1 Configuring the Putty
    6. 2.5 Remote Access of the Desktop
    7. 2.6 Summary
  4. Chapter 3: Using the Command Line
    1. 3.1 Overview
    2. 3.2 The Raspberry Pi Directory Structure
    3. 3.3 File Permissions
    4. 3.4 Help
    5. 3.5 Date, Time, and Calendar
    6. 3.6 File Operations
    7. 3.7 System and User Information
    8. 3.8 Resource Monitoring on Raspberry Pi
    9. 3.9 Shutting Down
  5. Chapter 4: Using a Text Editor in Command Mode
    1. 4.1 nano Text Editor
    2. 4.2 Summary
  6. Chapter 5: Creating and Running a Python Program
    1. 5.1 Overview
    2. 5.2 Method 1: Interactively from Command Prompt
    3. 5.3 Method 2: Create a Python File in Command Mode
    4. 5.4 Method 3: Create a Python File in GUI mode
    5. 5.5 Which Method?
    6. 5.6 Summary
  7. Chapter 6: Python Programming
    1. 6.1 Overview
    2. 6.2 Variable Names
    3. 6.3 Reserved Words
    4. 6.4 Comments
    5. 6.5 Line Continuation
    6. 6.6 Blank Lines
    7. 6.7 More Than One Statement on a Line
    8. 6.8 Indentation
    9. 6.9 Python Data Types
    10. 6.10 Numbers
    11. 6.11 Strings
    12. 6.11.1 String Functions
    13. 6.11.2 Escape Sequences
    14. 6.12 Print Statement
    15. 6.13 List Variables
    16. 6.13.1 List Functions
    17. 6.14 Tuple Variables
    18. 6.15 Dictionary Variables
    19. 6.15.1 Dictionary Functions
    20. 6.16 Keyboard Input
    21. 6.17 Comparison Operators
    22. 6.18 Logical Operators
    23. 6.19 Assignment Operators
    24. 6.20 Control of Flow
    25. 6.20.1 if, if-else, and elif
    26. 6.20.2 for Statement
    27. 6.20.3 while Statement
    28. 6.20.4 continue Statement
    29. 6.20.5 break Statement
    30. 6.20.6 pass Statement
    31. 6.21 Case Study 1 – 4 Band Resistor Colour Code Identifier
    32. 6.22 Case Study 2 – 4 Band Resistor Colour Code Identifier Including Small Resistors
    33. 6.23 Case Study 3 – Series or Parallel Resistors
    34. 6.24 Case Study 4 – Resistive Potential Divider
    35. 6.25 Trigonometric Functions
    36. 6.26 User-defined Functions
    37. 6.27 Example Programs
    38. 6.28 Case Study 5 - Resistive Attenuator Design – Equal Source & Load Resistances
    39. 6.29 Case Study 6 - Resistive Attenuator Design – Unequal Source & Load Resistances
    40. 6.30 Recursive Functions
    41. 6.31 Exceptions
    42. 6.31.1 try/finally Exceptions
    43. 6.32 Case Study 7 – Zener Diode Based Voltage Regulator
    44. 6.33 Date and Time
    45. 6.34 Creating Our Own Modules
    46. 6.35 Summary
  8. Chapter 7: Plotting Graphs With Python
    1. 7.1 Overview
    2. 7.2 The Matplotlib Graph Plotting Library
    3. 7.3 Case Study 8 – RC Transient Circuit Analysis - Charging
    4. 7.4 Case Study 9 – RC Transient Circuit Analysis - Discharging
    5. 7.5 Transient RL Circuits
    6. 7.6 Case Study 10 – RCL Transient Circuit Analysis
    7. 7.7 Summary
  9. Chapter 8: Files in Python With the Raspberry Pi
    1. 8.1 Overview
    2. 8.2 Python File Operations
    3. 8.3 Case Study 11 – RC Circuit Frequency Response
    4. 8.4 Case Study 12 – Save Raspberry Pi 4 CPU Temperature in a File
    5. 8.5 Saving Data on an External USB Memory Stick
    6. 8.6 Case Study 13 – Save Raspberry Pi 4 CPU Temperature on Memory Stick
    7. 8.7 Summary
  10. Chapter 9: Array and Matrix Operations With Python
    1. 9.1 Overview
    2. 9.2 Arrays
    3. 9.2.1 Array Operations and Functions
    4. 9.2.2 Array Multiplication
    5. 9.2.3 Copying Arrays
    6. 9.3 Systems of Linear Algebraic Equations
    7. 9.4 Case Study 14 – DC Circuits Mesh Analysis 1
    8. 9.5 Case Study 15 – DC Circuits Mesh Analysis 2
    9. 9.6 Case Study 16 – DC Circuits Mesh Analysis 3
    10. 9.7 Case Study 17 – DC Circuits Node Analysis 1
    11. 9.8 Summary
  11. Chapter 10: Using the Tkinter Graphical User Interface (GUI) in Python
    1. 10.1 Overview
    2. 10.2 GUI with the Tkinter
    3. 10.2.1 Label
    4. 10.2.2 Button
    5. 10.2.3 Message
    6. 10.2.4 Entry
    7. 10.2.5 Grid
    8. 10.2.6 Radio Button
    9. 10.2.7 Checkbox
    10. 10.2.8 Dialogs
    11. 10.2.9 Scale (Slider)
    12. 10.2.10 Menu
    13. 10.2.11 Binding to Events
    14. 10.3 Case Study 18 – Resonance in Series RLC Circuits
    15. 10.4 Case Study 19 – Inductance of a Single Layer Coil
    16. 10.5 Summary
  12. Chapter 11: BJT Transistor Circuit Analysis and Design
    1. 11.1 Overview
    2. 11.2 BJT Transistor DC Analysis
    3. 11.2.1 Collector Feedback Biasing
    4. 11.3 Case Study 20 – Analyzing Collector Feedback Biasing
    5. 11.4 Voltage Divider Biasing
    6. 11.5 Case Study 21 – Analyzing Voltage Divider Biasing
    7. 11.6 Case Study 22 – Designing Transistor Amplifier Circuit
    8. 11.7 Summary
  13. Chapter 12: Active Filters
    1. 12.1 Overview
    2. 12.2 Case Study 23 – Designing Low-Pass Active Filters
    3. 12.3 High-Pass Filters
    4. 12.4 Band-Pass Filters
    5. 12.5 Summary
  14. Chapter 13: Accessing Raspberry Pi 4 Hardware and Peripheral Devices From Python
    1. 13.1 Overview
    2. 13.2 GPIO – Parallel Interface
    3. 13.2.1 The GPIO Library
    4. 13.2.2 Pin Numbering
    5. 13.2.3 Channel (I/O port pin) Configuration
    6. 13.2.4 Case Study 24 – Flashing an LED
    7. 13.3 PWM
    8. 13.3.1 Case Study 25 – Changing the Brightness of an LED
    9. 13.4 I2C
    10. 13.4.1 Case Study 26 – Using I2C LCD
    11. 13.5 SPI
    12. 13.5.1 Case Study 27 – Using SPI – Analog Temperature Sensor
    13. 13.6 The serial
    14. 13.6.1 Case Study 28 – Using Serial Communication – Serial Loopback
    15. 13.7 Summary
  15. Chapter 14: Python and the Internet on Raspberry Pi 4
    1. 14.1 Overview
    2. 14.2 Internet Communication Protocols
    3. 14.3.1 Case Study 29 – Sending a Text Message to a Mobile Phone Using TCP/IP
    4. 14.3.2 Case Study 30 – Communicating with a PC Using TCP/IP
    5. 14.3.3 Case Study 31 – Controlling an LED Connected to Raspberry Pi From Mobile Phone Using TCP/IP
    6. 14.4 UDP Based Communication
    7. 14.4.1 Case Study 32 – Sending a Text Message to a Mobile Phone Using UDP
    8. 14.4.2 Case Study 33 – Controlling an LED Connected to Raspberry Pi From Mobile Phone Using UDP
    9. 14.5 Using Flask to Create a Web Server to Control Raspberry Pi GPIO Ports From the Internet
    10. 14.5.1 Case Study 34 – Web Server - Controlling an LED Connected to Raspberry Pi Using Flask
    11. 14.6 Summary
  16. Chapter 15: Bluetooth Communication on Raspberry Pi 4 Using Python
    1. 15.1 Overview
    2. 15.2 Case Study 35 – Bluetooth Control of LED From a Mobile Phone
    3. 15.3 Summary
  17. Appendix A: Using wxPython Graphical User Interface
    1. A.1 wxPython Template
    2. A.2 Some Example Widgets
    3. A.3 Case Study 36 – Display the Raspberry Pi 4 CPU Temperature Using wxPython
  18. Appendix B: Object-oriented Programming
    1. B.1 Classes and Methods
    2. B.2 Variables
    3. B.3 Inheritance

PDF preview unavailable. Download the PDF instead.

5347b16730e51033af3b7789048d70a1 Adobe InDesign 14.0 (Macintosh) Adobe PDF Library 15.0

Related Documents

Preview Internet of Things Projects and Tutorials
A comprehensive guide to Internet of Things (IoT) projects, covering Raspberry Pi, Arduino, and various sensors and communication methods. Includes practical examples and step-by-step instructions.
Preview Innovate with Sense HAT for Raspberry Pi: 45 Sensor Projects in Python
A comprehensive guide detailing 45 sensor projects using the Sense HAT add-on board with the Raspberry Pi, programmed in Python. It covers installation, basic and intermediate projects, emulator usage, Node-RED integration, and external component interaction.
Preview Raspberry Pi 4 and Pico Projects: Measuring, Controlling, Regulating
Explore practical projects for Raspberry Pi 4 and Raspberry Pi Pico, covering measurement, control, and regulation techniques with Python programming and hardware insights. This guide provides step-by-step instructions and project ideas for makers and electronics enthusiasts.
Preview C Programming on Raspberry Pi
A comprehensive guide to C programming on the Raspberry Pi, covering operating system setup, development tools, C language concepts, hardware interfacing with GPIO, I2C, SPI, and various practical projects involving LEDs, LCDs, and sensors.
Preview Using Displays in Raspberry Pi Projects: A Comprehensive Guide
Explore various display technologies with Raspberry Pi. This guide covers installation, programming, and practical projects for LCD, OLED, TFT, and e-paper displays, along with graphical interfaces.
Preview Raspberry Pi Pico Advanced Kit: Programming & Projects Guide
A comprehensive guide to programming and projects using the Raspberry Pi Pico and RP2040 microcontroller. This kit includes over 80 projects covering physical computing, sensors, displays, robotics, and Python programming.
Preview Mastering Multitasking on Raspberry Pi: A Comprehensive Guide
Explore advanced multitasking techniques, process management, threading, and multiprocessing with practical projects for the Raspberry Pi. This guide covers installation, command-line usage, and hands-on examples.
Preview Practical Electronics Crash Course: Learn Circuit Design the Fun Way
A comprehensive guide to practical electronics, covering fundamental concepts, passive and active components, circuits, and test and measurement techniques. This course is designed to make learning circuit design enjoyable and accessible.