tm1637 - tm1637 Digital tube#

Adaptation status unknown

Note

This page document is automatically generated by this file. If there is any error, please submit issue or help modify pr, thank you!

Example

--Note: due to the use of sys.wait() all apis need to be used in the coroutine
-- Usage Examples
local tm1637 = require "tm1637"
sys.taskInit(function()
    count = 0
    tm1637.init(1,4)
    tm1637.singleShow(0,2)
    tm1637.singleShow(1,1,true)
    tm1637.singleShow(2,3)
    tm1637.singleShow(3,6)
    while 1 do
        sys.wait(1000)
        if count > 7 then
            count = 0
        end
        log.info("Adjust brightness", count)
        tm1637.setLight(count)
        count = count + 1
    end
end)

tm1637.clear()#

TM1637 Display Empty

Parameters

None

Return Value

None

Examples

tm1637.clear()

tm1637.singleShow(com,date,comma)#

TM1637 Display

Parameters

Incoming Value Type

Explanation

number

com com Port number

number

date Display numbers, 0-9 shows 0-9,10 shows a, and so on.

bool

comma Comma or colon

Return Value

None

Examples

tm1637.singleShow(0,2)
tm1637.singleShow(1,1,true)
tm1637.singleShow(2,3)
tm1637.singleShow(3,6)

tm1637.setLight(light)#

TM1637 Set brightness

Parameters

Incoming Value Type

Explanation

number

light Brightness,0-7

Return Value

None

Examples

tm1637.setLight(3)

tm1637.init(scl,sda)#

TM1637 Initialization

Parameters

Incoming Value Type

Explanation

number

scl i2c_scl

number

sda i2c_sda

Return Value

return value type

explanation

bool

Successful return true

Examples

tm1637.init(1,4)