adafruit_seesaw.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: https://circuitpython.org/
or Adafruit Blinka: https://circuitpython.org/blinka
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- class adafruit_seesaw.seesaw.Seesaw(i2c_bus, addr=73, drdy=None, reset=True)[source]¶
Driver for Seesaw i2c generic conversion trip
- Parameters:
i2c_bus (I2C) – Bus the SeeSaw is connected to
addr (int) – I2C address of the SeeSaw device
drdy (DigitalInOut) – Pin connected to SeeSaw’s ‘ready’ output
reset (bool) – Whether to do a software reset on init
- digital_read_bulk(pins, delay=0.008)[source]¶
Get the values of all the pins on the ‘A’ port as a bitmask
- digital_read_bulk_b(pins, delay=0.008)[source]¶
Get the values of all the pins on the ‘B’ port as a bitmask
- enable_encoder_interrupt(encoder=0)[source]¶
Enable the interrupt to fire when the encoder changes position
adafruit_seesaw.crickit
- Pin definition for Adafruit CRICKIT¶
adafruit_seesaw.analoginput
¶
- class adafruit_seesaw.analoginput.AnalogInput(seesaw, pin, delay=0.008)[source]¶
CircuitPython-compatible class for analog inputs
This class is intended to be a compatible subset of
analogio.AnalogIn
- property value¶
The current analog value on the pin, as an integer from 0..65535 (inclusive)
- property reference_voltage¶
The reference voltage for the pin
adafruit_seesaw.digitalio
¶
- class adafruit_seesaw.digitalio.DigitalIO(seesaw, pin)[source]¶
CircuitPython-compatible class for digital I/O pins
This class is intended to be a compatible subset of
digitalio.DigitalInOut
.Due to technical limitations, PULL_DOWNs are not supported.
- switch_to_output(value=False, drive_mode=digitalio.DriveMode.PUSH_PULL)[source]¶
Switch the pin to output mode
- property direction¶
Retrieve or set the direction of the pin
- property value¶
Retrieve or set the value of the pin
- property drive_mode¶
Retrieve or set the drive mode of an output pin
- property pull¶
Retrieve or set the pull mode of an input pin
adafruit_seesaw.keypad
¶
- class adafruit_seesaw.keypad.KeyEvent(num, edge)[source]¶
Holds information about a key event in its properties
- Parameters:
num (int) – The number of the key
edge (int) – One of the EDGE propertes of
adafruit_seesaw.keypad.Keypad
- class adafruit_seesaw.keypad.Keypad(i2c_bus, addr=73, drdy=None)[source]¶
On compatible SeeSaw devices, reads from a keypad.
- Parameters:
i2c_bus (I2C) – Bus the SeeSaw is connected to
addr (int) – I2C address of the SeeSaw device
drdy (DigitalInOut) – Pin connected to SeeSaw’s ‘ready’ output
- EDGE_HIGH = 0¶
Indicates that the key is currently pressed
- EDGE_LOW = 1¶
Indicates that the key is currently released
- EDGE_FALLING = 2¶
Indicates that the key was recently pressed
- EDGE_RISING = 3¶
Indicates that the key was recently released
- property interrupt_enabled¶
Retrieve or set the interrupt enable flag
- property count¶
Retrieve or set the number of keys
adafruit_seesaw.neopixel
¶
- adafruit_seesaw.neopixel.RGB = 'RGB'¶
Red Green Blue
- adafruit_seesaw.neopixel.GRB = 'GRB'¶
Green Red Blue
- adafruit_seesaw.neopixel.RGBW = 'RGBW'¶
Red Green Blue White
- adafruit_seesaw.neopixel.GRBW = 'GRBW'¶
Green Red Blue White
- class adafruit_seesaw.neopixel.NeoPixel(*args: Any, **kwargs: Any)[source]¶
Control NeoPixels connected to a seesaw
- Parameters:
seesaw (Seesaw) – The device
pin (int) – The pin number on the device
n (int) – The number of pixels
bpp (int) – The number of bytes per pixel
brightness (float) – The brightness, from 0.0 to 1.0
auto_write (bool) – Automatically update the pixels when changed
pixel_order (tuple) – The layout of the pixels. Use one of the order constants such as RGBW.
adafruit_seesaw.pwmout
¶
- class adafruit_seesaw.pwmout.PWMOut(seesaw, pin)[source]¶
A single seesaw channel that matches the
PWMOut
API.- property frequency¶
The overall PWM frequency in Hertz.
- property duty_cycle¶
16-bit value that dictates how much of one cycle is high (1) versus low (0). 65535 (0xffff) will always be high, 0 will always be low, and 32767 (0x7fff) will be half high and then half low.
- property fraction¶
Expresses duty_cycle as a fractional value. Ranges from 0.0-1.0.
adafruit_seesaw.robohat
- Pin definition for RoboHAT¶
- class adafruit_seesaw.robohat.MM1_Pinmap[source]¶
This class is automatically used by
adafruit_seesaw.seesaw.Seesaw
when a RoboHAT board is detected.It is also a reference for the capabilities of each pin.
- analog_pins = (35, 34)¶
The pins capable of analog output
- pwm_width = 16¶
The effective bit resolution of the PWM pins
- pwm_pins = (16, 17, 18, 19, 11, 10, 9, 8, 40, 41, 42, 43)¶
The pins capable of PWM output
- touch_pins = (7, 6, 5, 4)¶
The pins capable of touch input
adafruit_seesaw.rotaryio
¶
- class adafruit_seesaw.rotaryio.IncrementalEncoder(seesaw, encoder=0)[source]¶
IncrementalEncoder determines the relative rotational position based on two series of pulses.
- property position¶
The current position in terms of pulses. The number of pulses per rotation is defined by the specific hardware.
adafruit_seesaw.samd09
- Pin definition for Adafruit SAMD09 Breakout with seesaw¶
- class adafruit_seesaw.samd09.SAMD09_Pinmap[source]¶
This class is automatically used by
adafruit_seesaw.seesaw.Seesaw
when a SAMD09 Breakout is detected.It is also a reference for the capabilities of each pin.
- analog_pins = (2, 3, 4, 5)¶
The effective bit resolution of the PWM pins
- pwm_width = 8¶
The pins capable of PWM output
- pwm_pins = (4, 5, 6, 7)¶
No pins on this board are capable of touch input
adafruit_seesaw.tftshield18
- Pin definitions for 1.8” TFT Shield V2¶
- class adafruit_seesaw.tftshield18.Buttons(right, down, left, up, select, a, b, c)¶
- a¶
Alias for field number 5
- b¶
Alias for field number 6
- c¶
Alias for field number 7
- down¶
Alias for field number 1
- left¶
Alias for field number 2
- right¶
Alias for field number 0
- select¶
Alias for field number 4
- up¶
Alias for field number 3