pdated ultrasonic default

This commit is contained in:
Peli de Halleux 2018-01-05 21:29:52 -08:00
parent abeb378b17
commit c814728354
2 changed files with 14 additions and 3 deletions

11
docs/coding/ignition-1.md Normal file
View File

@ -0,0 +1,11 @@
# Ignition Activity 1
```blocks
sensors.touch1.onEvent(TouchSensorEvent.Pressed, function () {
brick.showImage(images.eyesDizzy)
})
sensors.ultrasonic4.onEvent(UltrasonicSensorEvent.ObjectDetected, function () {
brick.showImage(images.eyesTiredMiddle)
})
brick.showImage(images.eyesSleeping)
```

View File

@ -86,6 +86,9 @@ namespace sensors {
return this._query(); return this._query();
} }
} }
//% fixedInstance whenUsed block="ultrasonic 4" jres=icons.port4
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
//% fixedInstance whenUsed block="ultrasonic 1" jres=icons.port1 //% fixedInstance whenUsed block="ultrasonic 1" jres=icons.port1
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1) export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
@ -95,7 +98,4 @@ namespace sensors {
//% fixedInstance whenUsed block="ultrasonic 3" jres=icons.port3 //% fixedInstance whenUsed block="ultrasonic 3" jres=icons.port3
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3) export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
//% fixedInstance whenUsed block="ultrasonic 4" jres=icons.port4
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
} }