Skip to content

dmccreary/learning-micropython

Repository files navigation

Learning MicroPython

๐Ÿ“– Comprehensive educational resources for teaching and learning MicroPython and physical computing

๐ŸŒ View Documentation Website โ†’

GitHub Pages License: CC BY-NC-SA 4.0 MicroPython GitHub stars GitHub forks

๐ŸŽฏ About

This book contains comprehensive educational resources for learning MicroPython and physical computing with microcontrollers. Designed for students aged 10-18 but suitable for all ages, it provides hands-on programming experiences with real hardware including the Raspberry Pi Pico, the Raspberry Pi Pico W (wireless), the ESP32, sensors, displays, motors, and more.

๐Ÿ† What Makes This Special

  • ๐Ÿ“š Progressive Learning Path: 9 structured sections from basics to advanced robotics
  • ๐Ÿ”ง Hardware-First Approach: All examples tested on real microcontrollers
  • ๐ŸŽ“ Educational Focus: Extensively documented with troubleshooting guides
  • ๐Ÿค– AI-Enhanced Learning: Integrated AI prompts for concept explanation
  • ๐ŸŒ Open Source: Free educational resources under Creative Commons license

๐Ÿš€ Quick Start

For Students & Beginners

  1. Visit the documentation: dmccreary.github.io/learning-micropython
  2. Get hardware: Raspberry Pi Pico ($4) + breadboard + sensors
  3. Install Thonny IDE: Free Python development environment
  4. Start with basics: LED blink, buttons, sensors
  5. Build progressively: Work through sensors, displays, motors, robots

For Educators & Contributors

# Clone the repository
git clone https://github.com/dmccreary/learning-micropython.git
cd learning-micropython

# Install dependencies
pip install -r requirements.txt

# Serve documentation locally
mkdocs serve

# Deploy hardware examples using rshell
./src/unix-scripts/load-libs.sh

๐Ÿ“– Learning Sections

Section Topics Hardware
๐Ÿ”ฐ Introduction Physical computing, microcontroller basics -
๐Ÿ› ๏ธ Getting Started Board setup, IDE configuration, breadboards Pico, ESP32
โšก Basic Examples Blink, buttons, potentiometers, PWM LEDs, switches, motors
๐Ÿ” Sensors Temperature, distance, light, gesture, compass DHT11, HC-SR04, APDS9960
๐Ÿ”ง Motors & Servos DC motors, H-bridges, stepper motors, servos L293D, DRV8833, SG90
๐Ÿ“บ Displays OLED, LCD, LED matrices, 7-segment SSD1306, SH1106, MAX7219
๐Ÿ”Š Sound & Music Audio generation, music playback, I2S Buzzers, speakers, DAC
๐Ÿ“ก Wireless WiFi connectivity, web servers, IoT ESP32, Pico W
๐Ÿš€ Advanced Labs Interrupts, multi-core, memory, debugging -

๐Ÿ› ๏ธ Supported Hardware

๐ŸŽฏ Primary Microcontrollers

  • Raspberry Pi Pico/Pico W ($4, 264KB RAM)
  • ESP32 (WiFi-enabled alternative)
  • Cytron Maker Pi RP2040 ($11, educational board)

๐Ÿ“ฆ Compatible Sensors & Components

  • Sensors: Temperature, humidity, distance, light, gesture, compass
  • Displays: OLED (I2C/SPI), LCD, LED matrices, 7-segment
  • Motors: DC motors, servos, steppers with various drivers
  • Audio: Buzzers, speakers, I2S audio devices
  • LEDs: NeoPixel strips, matrices, individual LEDs

๐Ÿ—‚๏ธ Repository Structure

learning-micropython/
โ”œโ”€โ”€ docs/                    # MkDocs documentation source
โ”‚   โ”œโ”€โ”€ basics/             # Basic programming examples
โ”‚   โ”œโ”€โ”€ sensors/            # Sensor integration guides  
โ”‚   โ”œโ”€โ”€ displays/           # Display programming
โ”‚   โ”œโ”€โ”€ motors/             # Motor control
โ”‚   โ”œโ”€โ”€ sound/              # Audio and music
โ”‚   โ”œโ”€โ”€ wireless/           # Network programming
โ”‚   โ””โ”€โ”€ advanced-labs/      # Advanced topics
โ”œโ”€โ”€ src/                    # MicroPython source code
โ”‚   โ”œโ”€โ”€ drivers/            # Hardware driver libraries
โ”‚   โ”œโ”€โ”€ sensors/            # Sensor example code
โ”‚   โ”œโ”€โ”€ displays/           # Display demos
โ”‚   โ”œโ”€โ”€ motors/             # Motor control examples
โ”‚   โ”œโ”€โ”€ neopixels/          # LED pattern generators
โ”‚   โ”œโ”€โ”€ sound/              # Audio examples
โ”‚   โ””โ”€โ”€ kits/               # Educational kit projects
โ””โ”€โ”€ requirements.txt        # Development dependencies

๐ŸŽ“ Educational Kits & Projects

  • ๐Ÿค– Maker Pi RP2040 Robot: Complete robot development platform
  • ๐ŸŒˆ NeoPixel Projects: LED programming and pattern generation
  • ๐ŸŽต Spectrum Analyzer: Real-time audio visualization
  • ๐Ÿ“ป RFID Access Control: Security system projects
  • ๐ŸŽฎ Game Projects: OLED-based games like Pong

๐Ÿง‘โ€๐Ÿ’ป Development

Documentation (MkDocs)

# Serve locally for development
mkdocs serve

# Build static site
mkdocs build

# Deploy to GitHub Pages
mkdocs gh-deploy

Hardware Development

# Copy driver libraries to Pico
rshell -p /dev/ttyACM0 cp src/drivers/*.py /pico/lib/

# Interactive shell with Pico
rshell -p /dev/ttyACM0

# Alternative: Use mpremote
mpremote connect /dev/ttyACM0 fs ls

๐Ÿค Contributing

We welcome contributions! This project serves students and educators worldwide.

  1. Fork the repository
  2. Create a feature branch
  3. Add educational content (include wiring diagrams and comments)
  4. Test on real hardware
  5. Submit a pull request

๐Ÿ“ Contribution Guidelines

  • All hardware examples must include circuit diagrams
  • Code should be extensively commented for educational purposes
  • Include troubleshooting sections for common issues
  • Progress from simple to complex examples
  • Test on actual hardware before submitting

๐Ÿ“œ License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

License: CC BY-NC-SA 4.0

You are free to:

  • โœ… Share โ€” copy and redistribute the material
  • โœ… Adapt โ€” remix, transform, and build upon the material

Under these terms:

  • ๐Ÿท๏ธ Attribution โ€” Give appropriate credit and link to license
  • ๐Ÿšซ NonCommercial โ€” Not for commercial use
  • ๐Ÿ”„ ShareAlike โ€” Distribute contributions under same license

Full license details โ†’

๐Ÿ™ Acknowledgements

This project builds upon the incredible work of the open source community. We gratefully acknowledge:

๐Ÿ”ง Core Technologies

๐Ÿ“ฆ Python Libraries

  • rshell - MicroPython remote shell
  • pyserial - Serial communication
  • numpy - Numerical computing
  • plotly - Interactive visualization

๐Ÿ”Œ Hardware Drivers & Libraries

๐Ÿ“Š Visualization & Web

๐Ÿ‘ฅ Special Thanks

Full acknowledgements โ†’

๐Ÿ“ž Contact & Support

โญ Show Your Support

If this project helps you teach or learn MicroPython, please consider:

  • โญ Starring this repository
  • ๐Ÿด Forking and contributing
  • ๐Ÿ“ข Sharing with educators and students
  • ๐Ÿ’ก Submitting new project ideas

๐ŸŽฏ Mission: Making physical computing and robotics accessible to students and educators worldwide through comprehensive, hands-on MicroPython education.

Built with โค๏ธ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7

Languages