tm1638

package module
v0.0.0-...-ae67505 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2020 License: BSD-2-Clause Imports: 2 Imported by: 0

README

tm1638: Go port of tm1638 library !! DEPRECATED !!

Check out github.com/suapapa/go_devices/tm1638 which base on phriph.io

video

Dependency

go get github.com/davecheney/gpio

Install

go get github.com/suapapa/go_tm1638

Build Example

cd example
GOARCH=arm GOOS=linux go build

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color byte

Color is type for LED colors

const (
	ColorNone Color = iota
	ColorGreen
	ColorRed
)

TM1638Color... are color of leds

type TM1638

type TM1638 struct {
	// contains filtered or unexported fields
}

TM1638 represent TM1638 base device

func NewTM1638

func NewTM1638(data, clk, strobe int) (*TM1638, error)

NewTM1638 retrives Pointer of a TM1638

func (TM1638) ClearDigit

func (d TM1638) ClearDigit(pos int, dot bool)

ClearDigit clear digit in given position

func (TM1638) Close

func (d TM1638) Close()

Close closes all open pins

func (TM1638) DisplayBinNumber

func (d TM1638) DisplayBinNumber(num byte, dots byte)

DisplayBinNumber displays binary number on display

func (TM1638) DisplayDecNumber

func (d TM1638) DisplayDecNumber(num uint64, dots byte, leadingZeros bool)

DisplayDecNumber displays dec numbers on display

func (TM1638) DisplayDecNumberAt

func (d TM1638) DisplayDecNumberAt(num uint64, dots byte, startPos int, leadingZeros bool)

DisplayDecNumberAt displays dec numbers at startPos on displays

func (TM1638) DisplayDigit

func (d TM1638) DisplayDigit(digit byte, pos int, dot bool)

DisplayDigit displays a digit

func (TM1638) DisplayError

func (d TM1638) DisplayError()

DisplayError display Error

func (TM1638) DisplayHexNumber

func (d TM1638) DisplayHexNumber(num uint64, dots byte, leadingZeros bool)

DisplayHexNumber displays hex numbers on displays

func (TM1638) DisplaySignedDecNumber

func (d TM1638) DisplaySignedDecNumber(num int64, dots byte, leadingZeros bool)

DisplaySignedDecNumber displays signed dec numbers on display

func (TM1638) GetButton

func (d TM1638) GetButton() byte

GetButton read buttons

func (TM1638) SetLED

func (d TM1638) SetLED(c Color, pos byte)

SetLED sets led in pos to given color

func (TM1638) SetLEDs

func (d TM1638) SetLEDs(leds uint16)

SetLEDs sets leds

func (TM1638) SetupDisplay

func (d TM1638) SetupDisplay(active bool, intensity byte)

SetupDisplay initialized the display

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL