2021-03-26 18:12:02 +01:00
2021-03-26 18:03:15 +01:00
2021-01-20 12:56:22 +01:00
2021-01-08 11:32:49 +01:00
2021-03-26 18:09:48 +01:00
2019-12-17 22:09:23 +01:00
2020-09-11 11:31:07 +02:00
2021-03-26 18:10:39 +01:00
2021-01-20 12:56:22 +01:00
2021-03-26 18:03:15 +01:00
2021-01-20 12:56:22 +01:00
2021-01-20 12:56:22 +01:00
2020-02-08 19:54:31 +01:00
2020-09-17 10:09:25 +02:00
2021-03-26 18:03:15 +01:00
2021-03-26 18:10:39 +01:00

TinyGo Drivers

PkgGoDev CircleCI

This package provides a collection of hardware drivers for devices such as sensors and displays that can be used together with TinyGo.

Installing

go get tinygo.org/x/drivers

How to use

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

package main

import (
    "time"

    "machine"

    "tinygo.org/x/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

The following 58 devices are supported.

Device Name Interface Type
ADT7410 I2C Temperature Sensor I2C
ADXL345 accelerometer I2C
AMG88xx 8x8 Thermal camera sensor I2C
APA102 RGB LED SPI
AT24CX 2-wire serial EEPROM I2C
BBC micro:bit LED matrix GPIO
BH1750 ambient light sensor I2C
BlinkM RGB LED I2C
BME280 humidity/pressure sensor I2C
BMI160 accelerometer/gyroscope SPI
BMP180 barometer I2C
BMP280 temperature/barometer I2C
BMP388 pressure sensor I2C
Buzzer GPIO
DHTXX thermometer and humidity sensor GPIO
DS1307 real time clock I2C
DS3231 real time clock I2C
ESP32 as WiFi Coprocessor with Arduino nina-fw SPI
ESP8266/ESP32 AT Command set for WiFi/TCP/UDP UART
GPS module I2C/UART
HC-SR04 Ultrasonic distance sensor GPIO
HD44780 LCD controller GPIO/I2C
HUB75 RGB led matrix SPI
ILI9341 TFT color display SPI
4x4 Membrane Keypad GPIO
L293x motor driver GPIO/PWM
L9110x motor driver GPIO/PWM
LIS2MDL magnetometer I2C
LIS3DH accelerometer I2C
LSM6DS3 accelerometer I2C
MAG3110 magnetometer I2C
<<<<<<< HEAD
MAX7219 & MAX7221 display driver SPI

=======

docs: add missing new drivers added since last release | MCP23017 port expander | I2C | | MCP3008 analog to digital converter (ADC) | SPI | | Microphone - PDM | I2S/PDM | | MMA8653 accelerometer | I2C | | MPU6050 accelerometer/gyroscope | I2C | | PCD8544 display | SPI | | Resistive Touchscreen (4-wire) | GPIO | | Semihosting | Debug | | Shift register (PISO) | GPIO | | Shift registers (SIPO) | GPIO | | SHT3x Digital Humidity Sensor | I2C | | SPI NOR Flash Memory | SPI/QSPI | | SSD1306 OLED display | I2C / SPI | | SSD1331 TFT color display | SPI | | SSD1351 OLED display | SPI | | ST7735 TFT color display | SPI | | ST7789 TFT color display | SPI | | Stepper motor "Easystepper" controller | GPIO | | Thermistor | ADC | | TMP102 I2C Temperature Sensor | I2C | | VEML6070 UV light sensor | I2C | | VL53L1X time-of-flight distance sensor | I2C | | Waveshare 2.13" (B & C) e-paper display | SPI | | Waveshare 2.13" e-paper display | SPI | | Waveshare 4.2" e-paper B/W display | SPI | | WS2812 RGB LED | GPIO |

Contributing

Your contributions are welcome!

Please take a look at our CONTRIBUTING.md document for details.

License

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

S
Description
TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
Readme BSD-3-Clause 26 MiB
Latest
2026-04-21 08:44:44 +00:00
Languages
Go 99.1%
Shell 0.7%