Skip to content
TinyGo drivers for sensors and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
Branch: master
Clone or download
deadprogram and aykevl build: use Makefile test command for CI tests
Signed-off-by: Ron Evans <ron@hybridgroup.com>
Latest commit c259da1 May 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci build: use Makefile test command for CI tests May 17, 2019
adxl345 adxl345: update ADXL345 driver and example to make uniform with other… May 3, 2019
apa102 apa102: add support for APA102 SPI controlled LEDs Dec 22, 2018
bh1750 i2c: refactor all i2c drivers to use Address property of Driver. Allo… Apr 7, 2019
blinkm i2c: refactor all i2c drivers to use Address property of Driver. Allo… Apr 7, 2019
bmp180 bmp180: change method names/signature for obtaining temperature and p… Apr 24, 2019
ds3231 ds3231: basic support for DS3231 RTC device Apr 7, 2019
easystepper easystepper: very simple 4-wire stepper driver Feb 23, 2019
espat espat: add support for esp8266/esp32 Wifi adaptor AT command set with… Feb 24, 2019
examples Support for Waveshare 2.13" (B & C versions) e-paper display (#56) May 17, 2019
hd44780 SetPixel removed, formatting May 5, 2019
hub75 Initial support for RGB led matrix, usually called hub75 Apr 26, 2019
lis3dh lis3dh: implement accelerometer functionality Apr 24, 2019
mag3110 mag3110: change method name/signature for obtaining temperature to be… May 3, 2019
microbitmatrix Driver for BBC micro:bit on-board LED matrix (#48) May 5, 2019
mma8653 i2c: refactor all i2c drivers to use Address property of Driver. Allo… Apr 7, 2019
mpu6050 i2c: refactor all i2c drivers to use Address property of Driver. Allo… Apr 7, 2019
pcd8544 clean commit, added smoke tests May 3, 2019
sht3x SHT3x driver (#53) May 12, 2019
ssd1306 support for SSD1306 displays using I2C or SPI, several screen sizes (#49 May 5, 2019
thermistor thermistor: add support for thermistors such as the NTC 3950 Apr 25, 2019
vl53v1x i2c: refactor all i2c drivers to use Address property of Driver. Allo… Apr 7, 2019
waveshare-epd/epd2in13x Support for Waveshare 2.13" (B & C versions) e-paper display (#56) May 17, 2019
ws2812 ws2812: add support for M0 at 48MHz: most SAMD21 boards Feb 24, 2019
.gitignore build: use Makefile test command for CI tests May 17, 2019
LICENSE license: add BSD-3 license for the TinyGo Authors Feb 7, 2019
Makefile build: use Makefile test command for CI tests May 17, 2019
README.md Support for Waveshare 2.13" (B & C versions) e-paper display (#56) May 17, 2019
displayer.go Define common display interface (#31) Apr 24, 2019
drivers.go bmp180: change method names/signature for obtaining temperature and p… Apr 24, 2019

README.md

TinyGo Drivers

GoDoc CircleCI

This package provides a collection of hardware drivers for devices that can be used together with TinyGo.

Installing

go get github.com/tinygo-org/drivers

How to use

Here is an example in TinyGo that uses the BMP180 digital barometer:

package main

import (
    "time"

    "machine"

    "github.com/tinygo-org/drivers/bmp180"
)

func main() {
    machine.I2C0.Configure(machine.I2CConfig{})
    sensor := bmp180.New(machine.I2C0)
    sensor.Configure()

    connected := sensor.Connected()
    if !connected {
        println("BMP180 not detected")
        return
    }
    println("BMP180 detected")

    for {
        temp, _ := sensor.ReadTemperature()
        println("Temperature:", float32(temp)/1000, "ºC")

        pressure, _ := sensor.ReadPressure()
        println("Pressure", float32(pressure)/100000, "hPa")

        time.Sleep(2 * time.Second)
    }
}

Currently supported devices

Device Name Interface Type
ADXL345 accelerometer I2C
APA102 RGB LED SPI
BH1750 ambient light sensor I2C
BlinkM RGB LED I2C
BMP180 barometer I2C
DS3231 real time clock I2C
"Easystepper" stepper motor controller GPIO
ESP8266/ESP32 AT Command set for WiFi/TCP/UDP UART
HUB75 RGB led matrix SPI
LIS3DH accelerometer I2C
MAG3110 magnetometer I2C
BBC micro:bit LED matrix GPIO
MMA8653 accelerometer I2C
MPU6050 accelerometer/gyroscope I2C
PCD8544 display SPI
SHT3x Digital Humidity Sensor I2C
SSD1306 OLED display I2C / SPI
Thermistor ADC
VL53L1X time-of-flight distance sensor I2C
Waveshare 2.13" (B & C) e-paper display SPI
WS2812 RGB LED GPIO

Contributing

This collection of drivers is part of the TinyGo project. Patches are welcome but new drivers should follow the patterns established by similar existing drivers.

License

This project is licensed under the BSD 3-clause license, just like the Go project itself.

You can’t perform that action at this time.