Giter Club home page Giter Club logo

raspberrypi-tm1637's Introduction

数码管显示器驱动

raspberry pi LED数码管显示器驱动

驱动文件在tm1637.py里,使用示例

import RPi.GPIO as GPIO

from tm1637 import TM1637


# 默认使用 BOARD 编码
display = TM1637(clk=40, dio=38, brightnes=7, is_show_point=False, pin_mode=GPIO.BOARD)

# 显示1,2,3,4
display.show([1, 2, 3, 4])

# 清空显示屏
display.clear()

# 第三、第四个位置不显示东西
display.show([1, 2, None, None])

# 显示中间的点
display.show_point()

# 不显示中间的点
display.close_point()

# 设置显示屏亮度,0-7级
display.set_brightnes(1)

# 精确控制数码管的亮灭
display.show_data((0b1111111, 0b1111111, 0b1111111, 0b1000000))

# 关闭数码管
display.disable()

# 开启数码管
display.enable()

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.