Remove microbit matrix (#319)

* Remove matrix code from bbc:microbit, and move it to a driver
This commit is contained in:
Daniel Esteban
2019-05-05 16:25:50 +02:00
committed by Ron Evans
parent 7e46c1766d
commit fb952a722a
2 changed files with 10 additions and 72 deletions
+10 -5
View File
@@ -1,4 +1,4 @@
// blink program for the BBC micro:bit that uses the entire LED matrix
// blink program for the BBC micro:bit
package main
import (
@@ -6,14 +6,19 @@ import (
"time"
)
// The LED matrix in the micro:bit is a multiplexed display: https://en.wikipedia.org/wiki/Multiplexed_display
// Driver for easier control: https://github.com/tinygo-org/drivers/tree/master/microbitmatrix
func main() {
machine.InitLEDMatrix()
ledrow := machine.GPIO{machine.LED_ROW_1}
ledrow.Configure(machine.GPIOConfig{Mode: machine.GPIO_OUTPUT})
ledcol := machine.GPIO{machine.LED_COL_1}
ledcol.Configure(machine.GPIOConfig{Mode: machine.GPIO_OUTPUT})
ledcol.Low()
for {
machine.ClearLEDMatrix()
ledrow.Low()
time.Sleep(time.Millisecond * 500)
machine.SetEntireLEDMatrixOn()
ledrow.High()
time.Sleep(time.Millisecond * 500)
}
}