Coder Social home page Coder Social logo

jerry233333 / micropython-mpr121 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mcauser/micropython-mpr121

0.0 0.0 0.0 970 KB

MicroPython driver for MPR121 capacitive touch keypads and breakout boards

License: MIT License

Python 100.00%

micropython-mpr121's Introduction

MicroPython MPR121

MicroPython driver for MPR121 capacitive touch keypads and breakout boards.

demo

demo

Compatible with:

These boards use 3.3V logic, so you would want to use a logic level converter with this for 5V systems.

Examples

Copy the file to your device, using ampy, webrepl or compiling and deploying. eg.

$ ampy put mpr121.py

Basic usage

from machine import Pin, I2C
import mpr121
import time

i2c = I2C(scl=Pin(5), sda=Pin(4))
mpr = mpr121.MPR121(i2c, 0x5A)

while True:
	print(mpr.touched())
	time.sleep_ms(100)

For more detailed examples, see /examples

Parts

Connections

VCC GND STM32F407VET6 Mini

from machine import I2C
import mpr121
i2c = I2C(3)
mpr = mpr121.MPR121(i2c, 0x5A)
MPR121 STM32F407VET6
VCC 3V3 (or 5V)
IRQ D3 (optional)
SCL A8 (SCL)
SDA C9 (SDA)
GND GND
  • I2C(1) SCL=B6, SDA=B7
  • I2C(2) SCL=B10, SDA=B11
  • I2C(3) SCL=A8, SDA=C9

TinyPICO (ESP32)

from machine import Pin, I2C
import mpr121
i2c = I2C(scl=Pin(22), sda=Pin(21))
mpr = mpr121.MPR121(i2c, 0x5A)
MPR121 TinyPICO ESP32
VCC 3V3
IRQ GPIO32 (optional)
SCL GPIO22 (SCL)
SDA GPIO21 (SDA)
GND GND

Wemos D1 Mini (ESP8266)

from machine import Pin, I2C
import mpr121
i2c = I2C(scl=Pin(5), sda=Pin(4))
mpr = mpr121.MPR121(i2c, 0x5A)
MPR121 D1 Mini ESP8266
VCC 3V3
IRQ D3 (optional)
SCL D1 GPIO5 (SCL)
SDA D3 GPIO4 (SDA)
GND GND

Links

License

Licensed under the MIT License.

Copyright (c) 2018 Mike Causer

micropython-mpr121's People

Contributors

mcauser avatar tonino-rb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.