Skip to content

djantzen/pico_book

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pico Book

Implementations of the exercises in Get Started with MicroPython on Raspberry Pi Pico

Design goals

  • Modular code
  • Minimize thinking about pins and other physical minutiae, allow mental focus on behavior
  • Support automated unit and functional tests
  • Minimize on-device QA

To achieve these goals, the code is broken out into components, singletons, models and scripts A component is a physical device wired to the Pico using one or more pins. A model is a collection of components that interact. The primary singleton is the Pico class, which represents the microcontroller configuration i.e., allocation of pins. Scripts tie different components, models and singletons together into an executable.

Dependencies

  • Micropython 1.17 or greater
  • UnitTest
    • Install with micropython -m upip install unittest

Hardware Used

Functional Testing

To prove correct functioning of components and models, we can write functional tests that observe the states of IO channels. This is possible by providing mock implementations of machine classes for Pin, PWM, ADC, I2C and SPI.

Running Tests

micropython run_tests.py

Running Scripts

Within a micropython interactive session exec(open('scripts/the_script.py').read())

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published