-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.go
49 lines (39 loc) · 832 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
46
47
48
49
// Copyright 2019 Michal Derkacz. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This example shows the basic usage of available LEDs.
package main
import (
"time"
"github.com/embeddedgo/stm32/devboard/az3166/board/buttons"
"github.com/embeddedgo/stm32/devboard/az3166/board/leds"
)
func delay() {
if buttons.User.Read() != 0 {
time.Sleep(time.Second / 8)
} else {
time.Sleep(time.Second / 2)
}
}
func main() {
for {
leds.Blue.SetOff()
leds.User.SetOn()
delay()
leds.User.SetOff()
leds.Azure.SetOn()
delay()
leds.Azure.SetOff()
leds.WiFi.SetOn()
delay()
leds.WiFi.SetOff()
leds.Red.SetOn()
delay()
leds.Red.SetOff()
leds.Green.SetOn()
delay()
leds.Green.SetOff()
leds.Blue.SetOn()
delay()
}
}