Guest User

Untitled

a guest
Dec 19th, 2018
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.36 KB | None | 0 0
  1. func main() {
  2.         err := rpio.Open()
  3.         if err != nil {
  4.                 os.Exit(1)
  5.         }
  6.         defer rpio.Close()
  7.  
  8.         pin := rpio.Pin(7)
  9.         pin.Mode(rpio.Pwm)
  10.         pin.Freq(60*60)
  11.         pin.DutyCycle(0, 60)
  12.         // the LED will be blinking at 60Hz
  13.         // (source frequency divided by cycle length => 60*60/60 = 2000)
  14. }
Advertisement
Add Comment
Please, Sign In to add comment