drivers

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

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

Go to latest
Published: Mar 14, 2019 License: BSD-3-Clause Imports: 0 Imported by: 0

README

TinyGo Drivers

GoDoc

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.Temperature()
        println("Temperature:", float32(temp)/1000, "ºC")

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

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

Currently supported devices

Device Name Interface Type
APA102 RGB LED SPI
BH1750 ambient light sensor I2C
BlinkM RGB LED I2C
BMP180 barometer I2C
"Easystepper" stepper motor controller GPIO
ESP8266/ESP32 AT Command set for WiFi/TCP/UDP UART
MAG3110 magnetometer I2C
MMA8653 accelerometer I2C
MPU6050 accelerometer/gyroscope I2C
VL53L1X time-of-flight distance sensor I2C
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.

Documentation

Overview

Package drivers is just a placeholder for the sub-packages. It is here just to be able to install the package without errors using go get -d github.com/tinygo-org/drivers

Directories

Path Synopsis
Package apa102 implements a driver for the APA102 SPI LED.
Package apa102 implements a driver for the APA102 SPI LED.
Package bh1750 provides a driver for the BH1750 digital Ambient Light
Package bh1750 provides a driver for the BH1750 digital Ambient Light
Package blinkm implements a driver for the BlinkM I2C RGB LED.
Package blinkm implements a driver for the BlinkM I2C RGB LED.
Package bmp180 provides a driver for the BMP180 digital pressure sensor by Bosch
Package bmp180 provides a driver for the BMP180 digital pressure sensor by Bosch
Simple driver to rotate a 4-wire stepper motor
Simple driver to rotate a 4-wire stepper motor
Package espat implements TCP/UDP wireless communication over serial with a separate ESP8266 or ESP32 board using the Espressif AT command set across a UART interface.
Package espat implements TCP/UDP wireless communication over serial with a separate ESP8266 or ESP32 board using the Espressif AT command set across a UART interface.
examples
apa102
Connects to an APA102 SPI RGB LED strip with 30 LEDS.
Connects to an APA102 SPI RGB LED strip with 30 LEDS.
blinkm
Connects to an BlinkM I2C RGB LED.
Connects to an BlinkM I2C RGB LED.
espat/espconsole
This is a console to a ESP8266/ESP32 running on the device UART1.
This is a console to a ESP8266/ESP32 running on the device UART1.
espat/esphub
This is a sensor hub that uses a ESP8266/ESP32 running on the device UART1.
This is a sensor hub that uses a ESP8266/ESP32 running on the device UART1.
espat/espstation
This is a sensor station that uses a ESP8266 or ESP32 running on the device UART1.
This is a sensor station that uses a ESP8266 or ESP32 running on the device UART1.
mag3110
Connects to an MAG3110 I2C magnetometer.
Connects to an MAG3110 I2C magnetometer.
mma8653
Connects to an MMA8653 I2C accelerometer.
Connects to an MMA8653 I2C accelerometer.
mpu6050
Connects to an MPU6050 I2C accelerometer/gyroscope.
Connects to an MPU6050 I2C accelerometer/gyroscope.
ws2812
Connects to an WS2812 RGB LED strip with 10 LEDS, such as on an Adafruit Circuit Playground Express board.
Connects to an WS2812 RGB LED strip with 10 LEDS, such as on an Adafruit Circuit Playground Express board.
Package mag3110 implements a driver for the MAG3110 3-axis magnetometer by Freescale/NXP.
Package mag3110 implements a driver for the MAG3110 3-axis magnetometer by Freescale/NXP.
Package mma8653 provides a driver for the MMA8653 3-axis accelerometer by Freescale/NXP.
Package mma8653 provides a driver for the MMA8653 3-axis accelerometer by Freescale/NXP.
Package mpu6050 provides a driver for the MPU6050 accelerometer and gyroscope made by InvenSense.
Package mpu6050 provides a driver for the MPU6050 accelerometer and gyroscope made by InvenSense.
Package vl53l1x provides a driver for the VL53L1X time-of-flight distance sensor
Package vl53l1x provides a driver for the VL53L1X time-of-flight distance sensor
Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.
Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.

Jump to

Keyboard shortcuts

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