Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func main() {
- err := rpio.Open()
- if err != nil {
- os.Exit(1)
- }
- defer rpio.Close()
- pin := rpio.Pin(7)
- pin.Mode(rpio.Pwm)
- pin.Freq(60*60)
- pin.DutyCycle(0, 60)
- // the LED will be blinking at 60Hz
- // (source frequency divided by cycle length => 60*60/60 = 2000)
- }
Advertisement
Add Comment
Please, Sign In to add comment