-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (37 loc) · 877 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"fmt"
"time"
rpio "github.com/stianeikeland/go-rpio"
)
func main() {
fmt.Println("Hello slider!")
err := rpio.Open()
if err != nil {
panic(err)
}
defer rpio.Close()
motorController := NewMotorController()
motorController.Run(
WithDelay(5*time.Second),
WithTripDuration(10*time.Second),
WithRoundTripCount(2),
WithTripEndPause(2*time.Second),
)
fastestBlinker := NewBlinker(10, BlinkFastest)
fastestBlinker.Blink()
<-time.After(5 * time.Second)
fastestBlinker.Stop()
fastBlinker := NewBlinker(10, BlinkFast)
fastBlinker.Blink()
<-time.After(5 * time.Second)
fastBlinker.Stop()
slowBlinker := NewBlinker(10, BlinkSlow)
slowBlinker.Blink()
<-time.After(5 * time.Second)
slowBlinker.Stop()
slowestBlinker := NewBlinker(10, BlinkSlowest)
slowestBlinker.Blink()
<-time.After(5 * time.Second)
slowestBlinker.Stop()
}