Giter VIP home page Giter VIP logo

drivers's Introduction

TinyGo Drivers

GoDoc CircleCI

This package provides a collection of hardware drivers for devices 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 48 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
BMP180 barometer I2C
Buzzer 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
HUB75 RGB led matrix SPI
ILI9341 TFT color display SPI
L293x motor driver GPIO/PWM
L9110x motor driver GPIO/PWM
LIS3DH accelerometer I2C
LSM6DS3 accelerometer I2C
MAG3110 magnetometer 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
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
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.

drivers's People

Contributors

deadprogram avatar conejoninja avatar aykevl avatar bgould avatar k-brk avatar torntrousers avatar 13rac1 avatar simulot avatar xordspar0 avatar munsio avatar yannishuber avatar cmur2 avatar

Stargazers

 avatar

Watchers

James Cloos avatar

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.