pxt-ev3/libs/core/test.ts

46 lines
925 B
TypeScript
Raw Normal View History

2017-07-05 14:56:13 +02:00
screen.clear()
2017-12-13 19:29:12 +01:00
brick.print("PXT!", 10, 30, Draw.Quad)
2017-06-29 16:47:26 +02:00
2017-12-13 19:29:12 +01:00
brick.drawRect(40, 40, 20, 10, Draw.Fill)
brick.setStatusLight(StatusLight.Orange)
2017-07-05 20:17:26 +02:00
2017-12-13 19:29:12 +01:00
brick.heart.doubled().draw(100, 50, Draw.Double | Draw.Transparent)
2017-07-11 14:43:12 +02:00
brick.buttonEnter.onEvent(ButtonEvent.Bumped, () => {
2017-07-05 20:17:26 +02:00
screen.clear()
})
brick.buttonLeft.onEvent(ButtonEvent.Bumped, () => {
2017-12-13 19:29:12 +01:00
brick.drawRect(10, 70, 20, 10, Draw.Fill)
brick.setStatusLight(StatusLight.Red)
2017-12-13 19:29:12 +01:00
brick.setFont(brick.microbitFont())
2017-07-05 20:17:26 +02:00
})
brick.buttonRight.onEvent(ButtonEvent.Bumped, () => {
2017-12-13 19:29:12 +01:00
brick.print("Right!", 10, 60)
2017-07-05 20:17:26 +02:00
})
2017-07-05 14:56:13 +02:00
brick.buttonDown.onEvent(ButtonEvent.Bumped, () => {
2017-12-13 19:29:12 +01:00
brick.print("Down! ", 10, 60)
2017-07-05 14:56:13 +02:00
})
brick.buttonUp.onEvent(ButtonEvent.Bumped, () => {
2017-12-13 19:29:12 +01:00
brick.print("Up! ", 10, 60)
2017-07-05 14:56:13 +02:00
})
2017-07-02 13:32:17 +02:00
2017-07-10 13:47:00 +02:00
let num = 0
forever(() => {
2017-07-10 13:47:00 +02:00
serial.writeDmesg()
pause(100)
2017-07-10 13:47:00 +02:00
})
2017-07-10 15:43:54 +02:00
/*
forever(() => {
2017-07-10 15:43:54 +02:00
let v = input.color.getColor()
2017-10-24 14:30:05 +02:00
screen.print(10, 60, v + " ")
pause(200)
2017-07-10 15:43:54 +02:00
})
2017-10-24 20:58:52 +02:00
*/