Project: Electronics Bash - #22- Inputs and Outputs


So the Raspberry Pi is just a computer, right? A nice cheap computer, but just a computer... except this computer makes it really easy to tap into low-level GPIO interface lines to respond to buttons and switches and show its state on outputs like LEDs and speakers.

This week, we'll continue delving into programming on the Raspberry Pi with Python to make things blink, flash, and respond.

Topics Include:

  • -GPIO Core Concepts:
    • Voltages
    • Currents
  • Flashing, blinking, and dimming external LEDs
  • Responding to button and switch inputs
  • Python tidbits like:
    • importing other modules
    • user-defined functions
    • The time, gpiozero, sys, and random modules

Code

Led Minimum

Click here to view code on Github

GPIO Basic

Click here to view code on Github

GPIO Dimming

Click here to view code on Github

GPIO Button

Click here to view code on Github

Bargraph

Click here to view code on Github

Bargraph Dimming

Click here to view code on Github

Reaction Game

Click here to view code on Github

Prime Numbers

Click here to view code on Github

System Monitor

Click here to view code on Github

Resources and Links

Links and Resources:
Raspberry Pi Homepage: https://www.raspberrypi.org/
Raspberry Pi OS: https://www.raspberrypi.org/downloads/
MagPi Magazine: https://magpi.raspberrypi.org/
Python Reference: https://docs.python.org/3/tutorial/index.html

Getting Started:
Raspberry Pi Imager: https://www.raspberrypi.org/downloads/
Troubleshooting Guide: https://www.raspberrypi.org/learning/troubleshooting-guide/
Display Troubleshooting: https://www.raspberrypi.org/documentation/hardware/display/troubleshooting.md
Starting w/o a Monitor: https://bit.ly/33IvKCc

Materials:
Video on Raspberry Pi Supplies: https://youtu.be/zeHvQZzkxbk
Raspberry Pi 4: https://www.adafruit.com/product/4292
Power Supp;y: https://amzn.to/2PiU6u6
MicroSD Card: https://amzn.to/2EHfHdA
MicroSD Card Reader: https://amzn.to/2EEmNiR
Micro HDMI to HDMI Cable: https://amzn.to/3jWffYW
Keyboard and Mouse: https://amzn.to/39LRX3v
Cat5 Cable: https://amzn.to/2EzoJcm

Some of the above links are Amazon affiliate links - ordering products through these links provides a small amount of support to the channel at no cost to you.