Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 476 Bytes

on-shield-event.md

File metadata and controls

25 lines (19 loc) · 476 Bytes

On shield event

Run some code when display is present or absent.

controller.onShieldEvent(ControllerShieldEvent.Absent, function () {
	
})

Example

controller.onShieldEvent(ControllerShieldEvent.Absent, function () {
    basic.showNumber(0)
})
controller.onShieldEvent(ControllerShieldEvent.Present, function () {
    basic.showNumber(1)
    screen().fill(Math.random()*15)
})
display-shield=github:microbit-apps/display-shield