NubeIO / driver-rubix-compute-io

0 stars 0 forks source link

PWM issue #5

Open NubeDev opened 2 years ago

NubeDev commented 2 years ago

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

NubeDev commented 2 years ago

Install pipig

sudo apt-get install pigpio sudo apt-get install python-pigpio python3-pigpio

start pigpi

sudo pigpiod
NubeDev commented 2 years ago
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
    }

}
NubeDev commented 2 years ago

pigs i2c read

pigs i2crd 1 16
NubeDev commented 2 years ago

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