pxt-ev3/libs/core/test.ts
2017-07-05 17:53:22 +01:00

26 lines
584 B
TypeScript

screen.clear()
screen.setFont(ScreenFont.Large)
//screen.drawText(10, 30, "Hello PXT!")
for (let i = 0; i < 10; ++i)
screen.drawRect(10, 70, 20, 10, Draw.Fill)
//screen.drawEllipse(40, 40, 20, 10)
output.setLights(LightsPattern.GreenFlash)
input.buttonDown.onEvent(ButtonEvent.Click, () => {
screen.scroll(10)
})
input.buttonUp.onEvent(ButtonEvent.Click, () => {
screen.scroll(-10)
})
for (let i = 0; i < 3; ++i) {
loops.forever(() => {
let r = Math.randomRange(0, 100)
serial.writeValue("R", r)
loops.pause(1000)
})
loops.pause(300)
}