Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arikb/LKM1638
JY-LKM1638 board driver library for Micropython / WiPy
https://github.com/arikb/LKM1638
Last synced: about 16 hours ago
JSON representation
JY-LKM1638 board driver library for Micropython / WiPy
- Host: GitHub
- URL: https://github.com/arikb/LKM1638
- Owner: arikb
- License: gpl-3.0
- Created: 2016-07-07T12:04:45.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-07T12:17:53.000Z (over 8 years ago)
- Last Synced: 2024-04-22T12:34:17.111Z (7 months ago)
- Language: Python
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mpython - LKM1638 - Driver for JY-LKM1638 displays based on TM1638 controller. (精选驱动库 / 显示类)
- awesome-micropython - LKM1638 - Driver for JY-LKM1638 displays based on TM1638 controller. (Libraries / Display)
README
# LKM1638
JY-LKM1638 board driver library for Micropython / WiPyCode has been written from scratch by me:
Arik Baratz
but was HEAVILY inspired by the Arduino library by Ricardo Batista:
https://github.com/rjbatista/tm1638-library
This program is free software: you can redistribute it and/or modify
it under the terms of the version 3 GNU General Public License as
published by the Free Software Foundation.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/## Usage:
from machine import Pin
from LKM1638 import LKM1638, LED_RED, LED_NONEdisplay = LKM1638(Pin.board.GP8, Pin.board.GP30, Pin.board.GP31)
display.setup(True, 7)n = 0
while True:
display.print_number(n, 16)
n+=1234
for i, button in enumerate(display.get_buttons()):
if button:
display.set_led(i, LED_RED)
else:
display.set_led(i, LED_NONE)## WARNING ##
The JY-LKM1638 display is a 5v CMOS platform. This code has been tested on
WiPi - a 3.3v platform. While the diaplay can accept 3.3v input, WiPy cannot
accept a 5v input, which can happen on the DIO control.I've used a simple bidirectional level shifter, described here:
http://electronics.stackexchange.com/a/97892/116011
This level shifter already has pull-ups on both ends, so I have configured
DIO as an open drain output without a pull-up. If your hardware differs, you
would have to change it. Note that it's reinitialised in the _recv method.