929 B
929 B
icon Image
Create an icon image for the LED screen.
images.iconImage(IconNames.Heart);
There are lots of pre-made icon images you can use to display on the LED screen of the @boardname@. You choose an icon by its name.
Parameters
- i: the icon name of the image you want to show on the LED screen. You pick an icon image such as:
IconNames.Heart
.
Example
Show a happy face when button A is pressed or a sad face when button B is pressed.
let iamHappy = images.iconImage(IconNames.Happy)
let iamSad = images.iconImage(IconNames.Sad)
input.input.onButtonEvent(Button.A, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
iamHappy.showImage(0);
});
input.input.onButtonEvent(Button.B, DAL.MICROBIT_BUTTON_EVT_CLICK, () => {
iamSad.showImage(0);
});