* Add wifi driver comboat for Elecrow W5 rp2040 and rp2350 devices Combo-AT driver uses AT command set to talk to onboard rtl8720d wifi device. The driver supports UDP/TCP/TLS clients in Wifi STA mode. Support for UDP/TCP servers is not supported, currently. https://aithinker-combo-guide.readthedocs.io/en/latest/docs/instruction/index.html https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/index.html https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-examples/index.html * Add wifi driver comboat for Elecrow W5 rp2040 and rp2350 devices Combo-AT driver uses AT command set to talk to onboard rtl8720d wifi device. The driver supports UDP/TCP/TLS clients in Wifi STA mode. Support for UDP/TCP servers is not supported, currently. https://aithinker-combo-guide.readthedocs.io/en/latest/docs/instruction/index.html https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-set/index.html https://aithinker-combo-guide.readthedocs.io/en/latest/docs/command-examples/index.html * switch to comboat_fw build tag for examples/net's that work with comboat driver
TinyGo Drivers
This package provides a collection of over 100 different hardware drivers for devices such as sensors, displays, wireless adaptors, and actuators, that can be used together with TinyGo.
For the complete list, please see: https://tinygo.org/docs/reference/devices/
Installing
go get tinygo.org/x/drivers
How to use
Here is an example in TinyGo that uses the BMP180 digital barometer. This example should work on any board that supports I2C:
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)
}
}
Examples Using GPIO or SPI
If compiling these examples directly you are likely to need to make minor changes to the defined variables to map the pins for the board you are using. For example, this block in main.go:
var (
spi = machine.SPI0
csPin = machine.D5
)
It might not be obvious, but you need to change these to match how you wired your specific board. Constants are defined for each supported microcontroller.
For example, to change the definitions for use on a Raspberry Pi Pico using typical wiring, you might need to do this:
var (
spi = machine.SPI0
csPin = machine.GP17
)
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.