Merge branch 'master' into jres

This commit is contained in:
Peli de Halleux
2017-10-30 18:48:18 +01:00
committed by GitHub
15 changed files with 220 additions and 195 deletions

View File

@ -2,46 +2,46 @@ screen.clear()
screen.print("PXT!", 10, 30, Draw.Quad)
screen.drawRect(40, 40, 20, 10, Draw.Fill)
output.setStatusLight(LightsPattern.Orange)
motors.setStatusLight(LightsPattern.Orange)
screen.heart.doubled().draw(100, 50, Draw.Double | Draw.Transparent)
input.buttonEnter.onEvent(ButtonEvent.Click, () => {
sensors.buttonEnter.onEvent(ButtonEvent.Click, () => {
screen.clear()
})
input.buttonLeft.onEvent(ButtonEvent.Click, () => {
sensors.buttonLeft.onEvent(ButtonEvent.Click, () => {
screen.drawRect(10, 70, 20, 10, Draw.Fill)
output.setStatusLight(LightsPattern.Red)
motors.setStatusLight(LightsPattern.Red)
screen.setFont(screen.microbitFont())
})
input.buttonRight.onEvent(ButtonEvent.Click, () => {
sensors.buttonRight.onEvent(ButtonEvent.Click, () => {
screen.print("Right!", 10, 60)
})
input.buttonDown.onEvent(ButtonEvent.Click, () => {
sensors.buttonDown.onEvent(ButtonEvent.Click, () => {
screen.print("Down! ", 10, 60)
})
input.buttonUp.onEvent(ButtonEvent.Click, () => {
sensors.buttonUp.onEvent(ButtonEvent.Click, () => {
screen.print("Up! ", 10, 60)
})
let num = 0
input.touchSensor1.onEvent(TouchSensorEvent.Bumped, () => {
sensors.touchSensor1.onEvent(TouchSensorEvent.Bumped, () => {
screen.print("Click! " + num, 10, 60)
num++
})
input.remoteButtonTopLeft.onEvent(ButtonEvent.Click, () => {
sensors.remoteButtonTopLeft.onEvent(ButtonEvent.Click, () => {
screen.print("TOPLEFT " + num, 10, 60)
num++
})
input.remoteButtonTopRight.onEvent(ButtonEvent.Down, () => {
sensors.remoteButtonTopRight.onEvent(ButtonEvent.Down, () => {
screen.print("TOPRIGH " + num, 10, 60)
num++
})