This book is a major edition, as many aspects have been changes, rewritten, updated, and created. You can do many things with the Raspberry Pi, and some have built a Star Trek interface, while others have built robots. This book provides the building block to work with Xojo to react with the real world through its motherboard to allow you to make your own interesting device. This inexpensive computer can be programed by the widely recognized Xojo programming language.
This book “I Wish I Knew How to … Program Raspberry Pi 4B Electronics with Xojo” goes into the numerous programs that can be built to interact with many types of electronic gadgets.This book uses the latest Raspberry Pi 4B hardware with the newest version of the Buster Operating System.
Note: There is a different book for the older version for pre Xojo 2019 r1.1, Jessie OS, and pre-Pi 3 B hardware. This book is for programing with the latest Raspberry Pi 4 B hardware, with the Buster OS, and API2 2019 r3.1 Xojo IDE with pigpio!
The ‘I Wish I Knew’ series contains technical data and advice that makes sense and contains practical and numerous examples with explanations to allow you to ease into the steep programming curve. There are many electronic examples and the book also has many references to the Stretch Linux Operating System that is used with the Raspberry Pi.
You can start building your own electronic projects with Raspberry Pi today!
Click to download the Raspberry Pi Table of Contents, which has a listing of all of the examples in the book, many of the terms, and commands used in the operating system. The book can be purchased at: Raspberry Pi 4B Electronics Book.
Major updates to the book are:
- Wrote using the newest Xojo 2019 r3.1 (Xojo API2) code
- Uses the latest Raspberry Pi Operating System (Buster)
- Wrote a new pigpio library wrapper (wiringPi is deprecated)
There are 27 chapters with more than 650 pages with over 70 example programs.
Examples include LED displays, Stepper motors, Ultrasonic distance, LCD words, graphics, and custom glyphs, infrared sensors, photo and video recording, servos, LEDs, infrared receivers, and more. Many screenshots have been added to show the results of the code with a full index to help find topics quickly. Examples include a circuit diagram or breakout board diagram to help with wiring the components on the Raspberry Pi. The book is in PDF format with example chapter folders containing Xojo source code and running examples.
The new and free pigpio wrapper can be downloaded at: Xojo pigpio wrapper.
It is assumed that you have an intermediate understanding of both electronics and programming of the Xojo language.
This ebook is a pdf formatted document and all examples include Xojo code. This is one of many books which can be purchased at Xojo Library.
Note: Xojo has free Raspberry Pi licenses!!
Example from the book
Example 26-2 from the book
Here is an example of a: Stepper Motor Video - Example 24-7 - Rasbperry Pi 4 B Video
Version 3.0 – Released in June 2020
Changes to Version 3.0
- Added Example 5-10 using the added set_pull_up_down internal resistor for Pulling the voltage down
- Added Example 5-11 using the added set_pull_up_down internal resistor for Pulling the voltage up to 3.3 volts
- Added Example11-3 to play movie files that have been created by the camera.
- Wrote using newest Xojo 2019 R3.1 (Xojo API 2) code
- Wrote with newest Raspberry Pi Operating System
- Wrote the book with the newest Raspberry Pi 4 B
- When files have been updated to Xojo API2 code, the suffix API2 was added to the example name
- Wrote new Open Source pigpio class (much of the previous pigpio is credited to the work from Ulrich Bogun)
- Updated some examples to further protect Raspberry Pi’s GPIO input electronics.
- More reference notes to increase the reliability of the Raspberry Pi
- Updated Example 3-4 to FolderItem.Constructor from GetFolderItem, and updated to API2.
- Added additional Sound Configuration with sounds with raspi-config
- Removed wiringPi GPIO module from all examples.
- Updated Example 5-2 to output voltage with the pigpio object and create gpio_write and set_mode methods, and update code to Xojo API2.
- Updated Example 5-3 to input voltage with gpio_read, and update code to Xojo API2.
- Example 5-4 uses gpio_read, pi.ON with pigpio, and updated to API2.
- Updated Example 5-5 with pigpio commands and updates to Xojo’s API2.
- Example 5-5 is updated to the new pigpio object with pi.OFF, gpio_write, and API2 for Xojo.
- Updated Example5-6 and Example5-7 code to pigpio and Xojo API2.
- Example 5-8 had a schematic added, updated code to Xojo API2 and pigpio.
- A schematic, updated Xojo API2 code, and pigpio object were added and updated to Example 5-9.
- Added three different PWM method descriptions in Chapter 6
- Example 6-2 – added gpioInitialize and hardware_PWM to vary LED lighting and changed to Xojo API2 code
- Example 6-3 – added commands for software PWM to change motor speed powered by a battery, and changed to Xojo API2 code.
- Example 6-4 – changed commands to Xojo API2 code
- Example 6-5 – updated Xojo code to API2, changed from wiringPi library commands to pigpio commands, changed pin 4 to pin 24, added pigpio_start method.
- Removed Example 6-7 as these calculations are no longer required, and the simplified set_servo_pulsewidth method is used in Example 6-6.
- Example 6-6 was completely rewritten for pigpio and uses set_servo_pulsewidth, and get_servo_pulsewidth. All code was updated to Xojo API2 and new methods were written.
- Example 6-8 updated library to pigpio and uses gpio_read method, and updated to Xojo API2.
- Example 6-9 updated to Xojo API2 and added PI_LOW, PI_HIGH constants along with pigpio update.
- Example 6-10 updated to Xojo API2 and updated to pigpio code.
- Updated Example 6-11 to Xojo API2 and replaced wiringPi code with pigpio code
- Example 7-1 updated code with pigpio and to Xojo API2.
- Example 7-2, modified example, floating inputs should have pull-down, and kept simple for understanding purposes. Updated to API2 Xojo code.
- Example 7-3, added pull-down for increased input circuit stability, updated code to Xojo API2, changed code to new pigpio object, checked for compatibity with Raspberry Pi OS.
- Example 7-9, added pull-down for increased input circuit stability, updated code to Xojo API2, changed code to new pigpio object.
- Example 8-1, updated to new pigpio library and updated code to Xojo API2, fixed error in schematic drawing.
- Example 8-2, improved electrical wiring of this example, updated pigpio library, and changed code to Xojo API2.
- Example 8-3 has updates to pigpio and to Xojo API2.
- Digital thermometer Example 9-1 had updates to pigpio, Xojo API2, and clarification in wiring breadboard.
- Infrared motion detection for Example 10-1 had updates to Xojo API2 and used the newer pigpio library for interactions with the GPIO.
- Example 11-1 had updates to Xojo API2.
- Updated Example 11-4 with Xojo API2 code.
- Example 20-1: Updated to new pigpio library code, to Xojo API2, and added a resistor for the incoming signal into the Raspberry Pi. Added schematic diagram.
- Example 12-1: Updated code to Xojo API2, added new pigpio library code and removed deprecated wiringPi code.
- Example 12-2: Updated code to Xojo API2, added new pigpio library code and removed deprecated wiringPi code.
- Example 12-3: Updated code to Xojo API2, added new pigpio library code and removed deprecated wiringPi code.
- Example 13-2: Added protective resistor to Raspberry Pi Input, Updated code to Xojo API2, replaced wiringPi code with pigpio code, added schematic and updated breadboard layout.
- Example 15-1: Added higher resistor to Pin #24 input for further protection. Changed code to pigpio library and updated to Xojo API2 code.
- Example 17-1 and Example 17-2: Update code to Xojo API2 and convert from wiringPi to new pigpio library.
- Examples 18-1 and 18-2, update code to Xojo API2, modify gpioInitialize to be inclusive of Daemon pigpiod status and rectify on startup. Include new pigpio object library.
- Example 19-1: interrupts are more responsive and faster with pigpio, updated code to Xojo API2.
- And a large amount of updates, upgrades, changes, compatibility modifications, and more to the remaining data.
Updates to version 3.1 (July 2020)
- Updated quickstart instructions with new link to pigpio library
- Updated Is a package installed instructions
- Updated purge program instructions
- Updated 555 timer interrupt library wording in book
- Removed wiringPi reference in Chapter 21
- Replaced SetupGPIO command in book for gpioInitialise pigpio command
- Updated old references from 3B+ to 4B Raspberry Pi
- Created Example 24-6 which has optimized code for a stepper motor driver which is quick and allows smooth motor movement on the OSEPP STEPD-01.
- Fixed grammatical errors.
- Removed Dim and replaced with Var in examples
- Created Example 24-7 with optimized timing code for Stepper motor with DRV8833 and NEMA 17.
Many thanks to Ulrich Bogun for his previous work with pigpio, and to Paul Lefebvre for his work with wiringPi and Xojo.