Dependencies¶
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.
Usage Example¶
See examples/seesaw_simpletest.py for usage example.
Contributing¶
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Building locally¶
To build this library locally you’ll need to install the circuitpython-build-tools package.
python3 -m venv .env
source .env/bin/activate
pip install circuitpython-build-tools
Once installed, make sure you are in the virtual environment:
source .env/bin/activate
Then run the build:
circuitpython-build-bundles --filename_prefix adafruit-circuitpython-seesaw --library_location .
Sphinx documentation¶
Sphinx is used to build the documentation based on rST files and comments in the code. First, install dependencies (feel free to reuse the virtual environment from above):
python3 -m venv .env
source .env/bin/activate
pip install Sphinx sphinx-rtd-theme
Now, once you have the virtual environment activated:
cd docs
sphinx-build -E -W -b html . _build/html
This will output the documentation to docs/_build/html
. Open the index.html in your browser to
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
locally verify it will pass.
Table of Contents¶
Simple test¶
Ensure your device works with this simple test.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # Simple seesaw test using an LED attached to Pin 15.
#
# See the seesaw Learn Guide for wiring details:
# https://learn.adafruit.com/adafruit-seesaw-atsamd09-breakout?view=all#circuitpython-wiring-and-test
import time
from board import SCL, SDA
import busio
import adafruit_seesaw
i2c_bus = busio.I2C(SCL, SDA)
ss = adafruit_seesaw.Seesaw(i2c_bus)
ss.pin_mode(15, ss.OUTPUT)
while True:
ss.digital_write(15, True) # turn the LED on (True is the voltage level)
time.sleep(1) # wait for a second
ss.digital_write(15, False) # turn the LED off by making the voltage LOW
time.sleep(1)
|
adafruit_seesaw
¶
An I2C to whatever helper chip.
- Author(s): Dean Miller
Implementation Notes¶
Hardware:
- Adafruit ATSAMD09 Breakout with seesaw (Product ID: 3657)
Software and Dependencies:
- Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases
- Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
-
class
adafruit_seesaw.
PWMChannel
(seesaw, pin)[source]¶ A single seesaw channel that matches the
PWMOut
API.-
duty_cycle
¶ 16 bit value that dictates how much of one cycle is high (1) versus low (0). 0xffff will always be high, 0 will always be low and 0x7fff will be half high and then half low.
-
frequency
¶ The overall PWM frequency in herz.
-