basic.showIcon(IconNames.Happy) basic.forever(function () { if (pins.digitalReadPin(DigitalPin.P0) == 1) { basic.showIcon(IconNames.Heart) basic.showNumber(1) basic.pause(2000) } else { basic.showIcon(IconNames.Happy) } })