Example scripts for the Analog Shield on a Phyduino Pico. There are two sets with the same examples: pick the Phyduino library you want to use with analog_shield.py.
| Examples | Uses | Laid out as |
|---|---|---|
| arduino.py examples | The Arduino-style functions: from arduino import *; pinMode(), digitalWrite(), analogRead() (0-1023), analogWrite() (0-255), delay() | An Arduino sketch: setup() runs once, then loop() runs over and over |
| phyduino.py examples | The Phyduino Pico library: import phyduino as mcu; pwm(), analog_averaging(), time.sleep() | A plain MicroPython script: the set-up code at the top runs once, then a while True: loop runs over and over |
Both need analog_shield.py on the board: mpremote cp analog_shield.py :.
There are also two standalone examples, written with phyduino.py only, that use more of the shield at once.