-
Notifications
You must be signed in to change notification settings - Fork 61
Add in Raspberry gpio pages for Part 1, Chapter 1 #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…pberry Pi overview and ADC explanation
… update judgement game output image and motor speed logger details
…ircuit components
…t circuit - and add captions
…ield-guide into raspberry_gpio
…ield-guide into rpi_gpio_P0_P1
…ield-guide into rpi_gpio_P0_P1
…ield-guide into rpi_gpio_P0_P1
… to "Binary Converter"
…ield-guide into rpi_gpio_P0_P1
…ield-guide into rpi_gpio_P0_P1
| --- | ||
|
|
||
| TODO: Overview of Raspberry Pi GPIO Pins: | ||
|
|
There was a problem hiding this comment.
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
-
pigpiodis running (start it after a reboot):sudo pigpiod
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
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:
/book/part-1-instructions/1-sequence-and-data/0-panorama/8-gpio-pins.mdxNote: broken link in this page is pointing to a page added in PR#66
/book/part-1-instructions/1-sequence-and-data/0-panorama/9-raspberry-gpio-methods.mdGuided Tour:
/book/part-1-instructions/1-sequence-and-data/1-tour/03-00-button-press-counter.mdx/book/part-1-instructions/1-sequence-and-data/1-tour/03-01-prepare-gpio-pins.mdx/book/part-1-instructions/1-sequence-and-data/1-tour/03-02-read-gpio-pin.mdxNote: broken link in this page is pointing to a page added in PR#66
/book/part-1-instructions/1-sequence-and-data/1-tour/03-03-multiple-readings.mdx/book/part-1-instructions/1-sequence-and-data/1-tour/03-04-count-presses.mdxActivities:
/book/part-1-instructions/1-sequence-and-data/3-explore/03-4-binary-converter.md