pxt-ev3/libs/core/test.ts

46 lines
936 B
TypeScript
Raw Normal View History

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