Documentation ¶
Overview ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package adxl345 provides a driver for the ADXL345 digital accelerometer.
|
Package adxl345 provides a driver for the ADXL345 digital accelerometer. |
Package apa102 implements a driver for the APA102 SPI LED.
|
Package apa102 implements a driver for the APA102 SPI LED. |
Package at24cx provides a driver for the AT24C32/64/128/256/512 2-wire serial EEPROM
|
Package at24cx provides a driver for the AT24C32/64/128/256/512 2-wire serial EEPROM |
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 bme280 provides a driver for the BME280 digital combined humidity and pressure sensor by Bosch.
|
Package bme280 provides a driver for the BME280 digital combined humidity and pressure sensor by Bosch. |
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. |
Package ds1307 provides a driver for the DS1307 RTC
|
Package ds1307 provides a driver for the DS1307 RTC |
Package ds3231 provides a driver for the DS3231 RTC
|
Package ds3231 provides a driver for the DS3231 RTC |
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. |
ds3231
Connects to an MAG3110 I2C magnetometer.
|
Connects to an MAG3110 I2C magnetometer. |
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. |
lis3dh
Connects to a LIS3DH I2C accelerometer on the Adafruit Circuit Playground Express.
|
Connects to a LIS3DH I2C accelerometer on the Adafruit Circuit Playground Express. |
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. |
thermistor
This example uses the settings for the thermistor that is built in to the Adafruit Circuit Playground Express.
|
This example uses the settings for the thermistor that is built in to the Adafruit Circuit Playground Express. |
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 gps provides a driver for GPS receivers over UART and I2C
|
Package gps provides a driver for GPS receivers over UART and I2C |
Package lis3dh provides a driver for the HD44780 LCD controller.
|
Package lis3dh provides a driver for the HD44780 LCD controller. |
Package hub75 implements a driver for the HUB75 LED matrix.
|
Package hub75 implements a driver for the HUB75 LED matrix. |
Package lis3dh provides a driver for the LIS3DH digital accelerometer.
|
Package lis3dh provides a driver for the LIS3DH digital accelerometer. |
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 microbitmatrix implements a driver for the BBC micro:bit's LED matrix.
|
Package microbitmatrix implements a driver for the BBC micro:bit's LED matrix. |
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 pcd8544 implements a driver for the PCD8544 48x84 pixels matrix LCD, used in Nokia's 5110 and 3310 phones.
|
Package pcd8544 implements a driver for the PCD8544 48x84 pixels matrix LCD, used in Nokia's 5110 and 3310 phones. |
Package sht3x provides a driver for the SHT3x digital humidity sensor series by Sensirion.
|
Package sht3x provides a driver for the SHT3x digital humidity sensor series by Sensirion. |
Package ssd1306 implements a driver for the SSD1306 led matrix controller, it comes in various colors and screen sizes.
|
Package ssd1306 implements a driver for the SSD1306 led matrix controller, it comes in various colors and screen sizes. |
Package thermistor is for temperature sensing using a thermistor such as the NTC 3950.
|
Package thermistor is for temperature sensing using a thermistor such as the NTC 3950. |
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 |
epd2in13
Package epd2in13 implements a driver for Waveshare 2.13in black and white e-paper device.
|
Package epd2in13 implements a driver for Waveshare 2.13in black and white e-paper device. |
epd2in13x
Package epd2in13x implements a driver for Waveshare 2.13in (B & C versions) tri-color e-paper device.
|
Package epd2in13x implements a driver for Waveshare 2.13in (B & C versions) tri-color e-paper device. |
Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips.
|
Package ws2812 implements a driver for WS2812 and SK6812 RGB LED strips. |
Click to show internal directories.
Click to hide internal directories.