Skip to content

CircuitPython library for MCP23017 16-bit I/O expander.

License

Notifications You must be signed in to change notification settings

ykochi/CircuitPython_MCP23017

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CircuitPython_MCP23017

CircuitPython library for MCP23017 16-bit I/O expander.

Example

import board
import digitalio
import busio

from mcp23017 import *


i2c = busio.I2C(board.SCL, board.SDA)
expander = MCP23017(i2c, address=0x20)

led = expander.gpio(GPB0)
led.direction = digitalio.Direction.OUTPUT

switch = expander.gpio(GPA7)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP

while True:
    if not switch.value:
        led.value = True
    else:
        led.value = False

About

CircuitPython library for MCP23017 16-bit I/O expander.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages