drivers: tinygo.org/x/drivers Index | Files | Directories

package drivers

import "tinygo.org/x/drivers"

Package drivers provides a collection of hardware drivers for devices that can be used together with TinyGo (https://tinygo.org).

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)
	}
}

Each individual driver is contained within its own sub-package within this package and there are no interdependencies in order to minimize the final size of compiled code that uses any of these drivers.

Index

Package Files

displayer.go drivers.go

type Displayer Uses

type Displayer interface {
    // Size returns the current size of the display.
    Size() (x, y int16)

    // SetPizel modifies the internal buffer.
    SetPixel(x, y int16, c color.RGBA)

    // Display sends the buffer (if any) to the screen.
    Display() error
}

Directories

PathSynopsis
adxl345Package adxl345 provides a driver for the ADXL345 digital accelerometer.
apa102Package apa102 implements a driver for the APA102 SPI LED.
at24cxPackage at24cx provides a driver for the AT24C32/64/128/256/512 2-wire serial EEPROM
bh1750Package bh1750 provides a driver for the BH1750 digital Ambient Light
blinkmPackage blinkm implements a driver for the BlinkM I2C RGB LED.
bme280Package bme280 provides a driver for the BME280 digital combined humidity and pressure sensor by Bosch.
bmp180Package bmp180 provides a driver for the BMP180 digital pressure sensor by Bosch.
ds1307Package ds1307 provides a driver for the DS1307 RTC
ds3231Package ds3231 provides a driver for the DS3231 RTC
easystepperSimple driver to rotate a 4-wire stepper motor
espatPackage 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.
gpsPackage gps provides a driver for GPS receivers over UART and I2C
hub75Package hub75 implements a driver for the HUB75 LED matrix.
lis3dhPackage lis3dh provides a driver for the LIS3DH digital accelerometer.
mag3110Package mag3110 implements a driver for the MAG3110 3-axis magnetometer by Freescale/NXP.
mma8653Package mma8653 provides a driver for the MMA8653 3-axis accelerometer by Freescale/NXP.
mpu6050Package mpu6050 provides a driver for the MPU6050 accelerometer and gyroscope made by InvenSense.
pcd8544Package pcd8544 implements a driver for the PCD8544 48x84 pixels matrix LCD, used in Nokia's 5110 and 3310 phones.
sht3xPackage sht3x provides a driver for the SHT3x digital humidity sensor series by Sensirion.
ssd1306Package ssd1306 implements a driver for the SSD1306 led matrix controller, it comes in various colors and screen sizes.
thermistorPackage thermistor is for temperature sensing using a thermistor such as the NTC 3950.
vl53l1xPackage vl53l1x provides a driver for the VL53L1X time-of-flight distance sensor
ws2812Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.

Package drivers imports 1 packages (graph). Updated 2019-06-16. Refresh now. Tools for package owners.