File tree Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Original file line number Diff line number Diff line change
1
+ //go:build darwin
2
+ // +build darwin
3
+
4
+ package bts7960
5
+
6
+ import (
7
+ "context"
8
+
9
+ "github.com/sirupsen/logrus"
10
+ )
11
+
12
+ // Forward makes the motor work in the forward way.
13
+ func (d * bts7960 ) Forward (ctx context.Context ) error {
14
+ logrus .Warningln ("We are on MAC OS, no action" )
15
+
16
+ // Wait
17
+ until , _ := ctx .Deadline ()
18
+ logrus .Infoln ("Wait until" , until )
19
+ <- ctx .Done ()
20
+
21
+ return nil
22
+ }
23
+
24
+ // Backward makes the motor work in the backward way.
25
+ func (d * bts7960 ) Backward (ctx context.Context ) error {
26
+ logrus .Warningln ("We are on MAC OS, no action" )
27
+
28
+ // Wait
29
+ until , _ := ctx .Deadline ()
30
+ logrus .Infoln ("Wait until" , until )
31
+ <- ctx .Done ()
32
+
33
+ return nil
34
+ }
35
+
36
+ // Stop the motor.
37
+ func (d * bts7960 ) Stop () error {
38
+ logrus .Warningln ("We are on MAC OS, no action" )
39
+
40
+ return nil
41
+ }
Original file line number Diff line number Diff line change 1
1
//go:build linux
2
+ // +build linux
2
3
3
4
package l293d
4
5
Original file line number Diff line number Diff line change
1
+ //go:build darwin
2
+ // +build darwin
3
+
4
+ package l293d
5
+
6
+ import (
7
+ "context"
8
+
9
+ "github.com/sirupsen/logrus"
10
+ )
11
+
12
+ // Forward makes the motor work in the forward way.
13
+ func (motor * l293d ) Forward (ctx context.Context ) error {
14
+ logrus .Warningln ("We are on MAC OS, no action" )
15
+
16
+ // Wait
17
+ until , _ := ctx .Deadline ()
18
+ logrus .Infoln ("Wait until" , until )
19
+ <- ctx .Done ()
20
+
21
+ return nil
22
+ }
23
+
24
+ // Backward makes the motor work in the backward way.
25
+ func (motor * l293d ) Backward (ctx context.Context ) error {
26
+ logrus .Warningln ("We are on MAC OS, no action" )
27
+
28
+ // Wait
29
+ until , _ := ctx .Deadline ()
30
+ logrus .Infoln ("Wait until" , until )
31
+ <- ctx .Done ()
32
+
33
+ return nil
34
+ }
35
+
36
+ // Stop the motor.
37
+ func (motor * l293d ) Stop () error {
38
+ logrus .Warningln ("We are on MAC OS, no action" )
39
+
40
+ return nil
41
+ }
Original file line number Diff line number Diff line change 1
1
//go:build windows
2
+ // +build windows
2
3
3
4
package l293d
4
5
You can’t perform that action at this time.
0 commit comments