Pygame Zero for Makers - Programming Raspberry Pi with Electronics using Python

Опубликовано: 15 Октябрь 2024
на канале: Penguin Tutor
3,906
43

Pygame Zero for Makers is a collection of resources to demonstrate how Pygame Zero can be used for Maker projects. This is designed for a Raspberry Pi, although can be used with other platforms. This includes using Pygame Zero as an alternative front end to electronic circuits, as well as how touch screens can be integrated into a maker project.

The overriding philosophy is that interfaces do not need to be boring.

These examples combine electronics connected to the Raspberry Pi with a fun graphical interface. The GPIO pins on the Raspberry Pi can be connected to various different electronic sensors or output devices, including LEDs, motors or a smoke generator. This is controlled using GPIO zero. The interface is a graphical interface using virtual buttons and images which the user can interact with. This is created using Python Pygame Zero. The interface can be used with a touch screen (such as the official Raspberry Pi touch screen) for a touch interface, or a regular screen using a mouse.

The accompanying worksheet is a tutorial that goes through simple switches and LEDs connected to the Raspberry Pi, but also show a bargraph, speedometer and how electronics in a 3D printed house can be controlled using Pygame Zero. This includes Christmas LEDs, a colour changing snowman and a smoke generator including in the building chimney. The building is created in approximately G-Scale so is suitable for use on an outdoor model railway. This is also included in the supplied source code.
See the worksheet and source code at: http://www.penguintutor.com/projects/...

You can see the video on using Blender to create simple sprites for computer games at:    • introduction to Blender - Creating 3D...  

More details on using Pygame Zero for programming a physical game are available at: http://www.penguintutor.com/projects/...

For more details of the breadboard mount see    • Beginners FreeCAD - Design and 3D pri...  


Chapters
00:00:00 Introduction
00:01:11 Workshop
00:01:40 Raspberry Pi, Touchscreen and Circuit Board
00:02:00 Circuit diagram for Button Switches and LEDs
00:02:17 Wiring up the circuit on a breadboard
00:20:04 Display graphical interface GUI
00:59:15 Bargraph and Speedometer displays
01:01:04 House display and smoke generator