mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 12:33:42 +00:00
examples: add microbit blink example
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
// blink program for the BBC micro:bit that uses the entire LED matrix
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"machine"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
machine.InitLEDMatrix()
|
||||||
|
|
||||||
|
for {
|
||||||
|
machine.ClearLEDMatrix()
|
||||||
|
time.Sleep(time.Millisecond * 500)
|
||||||
|
|
||||||
|
machine.SetEntireLEDMatrixOn()
|
||||||
|
time.Sleep(time.Millisecond * 500)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user