pxt-ev3/libs/core/test.ts

25 lines
551 B
TypeScript
Raw Normal View History

2017-07-05 14:56:13 +02:00
screen.clear()
2017-07-05 18:53:22 +02:00
screen.setFont(ScreenFont.Large)
2017-07-05 19:35:05 +02:00
screen.drawText(10, 30, "Hello PXT!")
2017-07-05 18:53:22 +02:00
screen.drawRect(10, 70, 20, 10, Draw.Fill)
2017-07-05 19:35:05 +02:00
screen.drawEllipse(40, 40, 20, 10)
2017-06-29 16:47:26 +02:00
2017-07-05 19:35:05 +02:00
output.setLights(LightsPattern.GreenPulse)
2017-07-05 14:56:13 +02:00
input.buttonDown.onEvent(ButtonEvent.Click, () => {
screen.scroll(10)
})
input.buttonUp.onEvent(ButtonEvent.Click, () => {
screen.scroll(-10)
})
2017-07-02 13:32:17 +02:00
2017-07-04 21:26:20 +02:00
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)
}