mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
microbit: add SetEntireLEDMatrixOn() function
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
committed by
Ayke van Laethem
parent
aee9eb413e
commit
ca13bfd992
@@ -96,3 +96,20 @@ func SetLEDMatrix(x, y uint8) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetEntireLEDMatrixOn turns on all of the LEDs on the LED matrix.
|
||||
func SetEntireLEDMatrixOn() error {
|
||||
set := 0
|
||||
for i := LED_ROW_1; i <= LED_ROW_3; i++ {
|
||||
set |= 1 << uint8(i)
|
||||
}
|
||||
nrf.GPIO.OUTSET = nrf.RegValue(set)
|
||||
|
||||
set = 0
|
||||
for i := LED_COL_1; i <= LED_COL_9; i++ {
|
||||
set |= 1 << uint8(i)
|
||||
}
|
||||
nrf.GPIO.OUTCLR = nrf.RegValue(set)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user