Skip to content

Conversation

@omckeon
Copy link
Contributor

@omckeon omckeon commented Jul 24, 2025

Description

This PR adds the following Raspberry Pi GPIO pages for Part 1, Chapter 1:

Note: This follows on from PR#66. The Raspberry Pi pages for the next chapters will be added in separate PRs.

Chapter 1: Sequence and Data

Overview:

  • Raspberry Pi GPIO Pins → /book/part-1-instructions/1-sequence-and-data/0-panorama/8-gpio-pins.mdx
    Note: broken link in this page is pointing to a page added in PR#66
  • GPIO methods to use → /book/part-1-instructions/1-sequence-and-data/0-panorama/9-raspberry-gpio-methods.md

Guided Tour:

  • Button Press Counter → /book/part-1-instructions/1-sequence-and-data/1-tour/03-00-button-press-counter.mdx
  • Step 2 - Initialise GPIO Pin → /book/part-1-instructions/1-sequence-and-data/1-tour/03-01-prepare-gpio-pins.mdx
  • Step 3 - Read GPIO Pin Value → /book/part-1-instructions/1-sequence-and-data/1-tour/03-02-read-gpio-pin.mdx
    Note: broken link in this page is pointing to a page added in PR#66
  • Step 4 - Multiple Button presses → /book/part-1-instructions/1-sequence-and-data/1-tour/03-03-multiple-readings.mdx
  • Step 5 - Counting button presses → /book/part-1-instructions/1-sequence-and-data/1-tour/03-04-count-presses.mdx

Activities:

  • Binary Converter → /book/part-1-instructions/1-sequence-and-data/3-explore/03-4-binary-converter.md

XQuestCode and others added 30 commits March 21, 2025 01:56
… update judgement game output image and motor speed logger details
---

TODO: Overview of Raspberry Pi GPIO Pins:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are GPIO pins?

General Purpose Input/Output pins let your Raspberry Pi sense or control simple electronic components. Each pin can be configured as an input (to read a signal) or an output (to send a signal). SplashKit provides a typed interface so you do not work with raw numbers.

Binary signals in practice

A digital signal is either low (0) or high (1). On the Raspberry Pi a high signal is 3.3 volts. This connects with the Machine Code ideas: the CPU ultimately deals in ones and zeroes, and GPIO lets you see and set those bits in the real world.

Pin numbering and safety

SplashKit’s GpioPin enum refers to the physical header numbers (Pin11, Pin13, and so on). Never feed 5 V into a GPIO pin.

Modes and pull resistors

Inputs read, outputs drive. Inputs can “float” if nothing is connected, so you usually enable an internal pull‑up (default high) or pull‑down (default low) resistor. Outputs ignore pull settings.

The usual GPIO workflow

Start the pigpiod daemon in the shell if you have just rebooted. In code, call RaspiInit once, set each pin’s mode (and pull for inputs), read or write as needed, then call RaspiCleanup before the program exits.

Quick reference

TODO : (Insert the short table above, then link to the SplashKit docs.) ??

Raspberry Pi GPIO pre‑flight checklist

1. Hardware and wiring

  • Power to the Pi is off while you wire components
  • LED polarity correct (long leg to GPIO via resistor, short leg to GND)
  • A current‑limiting resistor (≈220–330 Ω) is in series with the LED
  • Button wired between the chosen GPIO pin and 3.3 V or GND (match this to your pull‑up or pull‑down choice)
  • Ground connection is solid (all components share a GND with the Pi)
  • No 5 V line is touching a GPIO pin (GPIOs are 3.3 V tolerant only)

2. Pin choices and naming

  • You know which physical header pins you are using (for example GpioPin.Pin11)
  • You are not mixing physical pin numbers with Broadcom (BCM) numbers

3. System services

  • pigpiod is running (start it after a reboot):
    sudo pigpiod

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hope this helps? Extend / modify the checklist to cover what you want them to double check?

I like the idea of linking back to splashkit for the bulk of the references, but perhaps adding a tabl of common terms mght be good too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic Cliff! Thank you!

@omckeon omckeon marked this pull request as ready for review July 25, 2025 06:28
@omckeon omckeon requested a review from macite July 25, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants