Open NubeDev opened 2 years ago
Install pipig
sudo apt-get install pigpio sudo apt-get install python-pigpio python3-pigpio
start pigpi
sudo pigpiod
package main
import (
"changeme/pigpio"
"fmt"
)
func main() {
client, err := pigpio.New("192.168.15.10:8888")
fmt.Println(client, err)
if err != nil {
return
}
//CMD {4 23 1 0} write PIN23 ON (false)
//CMD {4 23 0 0} write OFF PIN23 (true)
write, err := client.Write(21, false)
fmt.Println(write, err)
if err != nil {
return
}
}
pigs i2c read
pigs i2crd 1 16
Enabe auto start of pigpio https://raspberrypi.stackexchange.com/questions/70568/how-to-run-pigpiod-on-boot https://raspberrypi.stackexchange.com/questions/104439/why-are-some-services-only-listening-on-ip6/104441#104441
sudo systemctl edit pigpiod
issue on writting to pwm https://github.com/google/periph/issues/363 https://pkg.go.dev/periph.io/x/periph/host/bcm283x#Pin.PWM
how to work with pwm https://jumpnowtek.com/rpi/Using-the-Raspberry-Pi-Hardware-PWM-timers.html
https://github.com/dotnet/iot/blob/main/Documentation/raspi-pwm.md#:~:text=IOException%3A%20Permission%20denied-,Enabling%20hardware%20PWM,channel%2C%20either%20a%20dual%20channel