fixed naming of sonar
This commit is contained in:
parent
b0380fbef8
commit
c4d3d7634e
@ -25,7 +25,7 @@
|
|||||||
"input.GyroSensor.rate|block": "%color|rotation rate",
|
"input.GyroSensor.rate|block": "%color|rotation rate",
|
||||||
"input.IrSensor.distance|block": "%infrared|distance",
|
"input.IrSensor.distance|block": "%infrared|distance",
|
||||||
"input.IrSensor.remoteCommand|block": "%infrared|remote command",
|
"input.IrSensor.remoteCommand|block": "%infrared|remote command",
|
||||||
"input.UltraSonicSensor.distance|block": "%sonar|distance",
|
"input.UltraSonicSensor.distance|block": "%sensor|distance",
|
||||||
"input.buttonDown|block": "button down",
|
"input.buttonDown|block": "button down",
|
||||||
"input.buttonEnter|block": "button enter",
|
"input.buttonEnter|block": "button enter",
|
||||||
"input.buttonLeft|block": "button left",
|
"input.buttonLeft|block": "button left",
|
||||||
@ -48,10 +48,10 @@
|
|||||||
"input.touchSensor2|block": "touch sensor 2",
|
"input.touchSensor2|block": "touch sensor 2",
|
||||||
"input.touchSensor3|block": "touch sensor 3",
|
"input.touchSensor3|block": "touch sensor 3",
|
||||||
"input.touchSensor4|block": "touch sensor 4",
|
"input.touchSensor4|block": "touch sensor 4",
|
||||||
"input.ultrasonic1|block": "ultrasonic 1",
|
"input.ultrasonic1|block": "ultrasonic sensor 1",
|
||||||
"input.ultrasonic2|block": "ultrasonic 1",
|
"input.ultrasonic2|block": "ultrasonic sensor 1",
|
||||||
"input.ultrasonic3|block": "ultrasonic 1",
|
"input.ultrasonic3|block": "ultrasonic sensor 1",
|
||||||
"input.ultrasonic4|block": "ultrasonic 1",
|
"input.ultrasonic4|block": "ultrasonic sensor 1",
|
||||||
"input|block": "input",
|
"input|block": "input",
|
||||||
"output.getCurrentSpeed|block": "motor %out|speed",
|
"output.getCurrentSpeed|block": "motor %out|speed",
|
||||||
"output.pattern|block": "%pattern",
|
"output.pattern|block": "%pattern",
|
||||||
@ -77,5 +77,5 @@
|
|||||||
"{id:group}Lights": "Lights",
|
"{id:group}Lights": "Lights",
|
||||||
"{id:group}Motors": "Motors",
|
"{id:group}Motors": "Motors",
|
||||||
"{id:group}Screen": "Screen",
|
"{id:group}Screen": "Screen",
|
||||||
"{id:group}Sonar": "Sonar"
|
"{id:group}Ultrasonic sensor": "Ultrasonic sensor"
|
||||||
}
|
}
|
@ -12,15 +12,15 @@ namespace input {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the distance from the sonar in millimeters
|
* Gets the distance from the sonar in millimeters
|
||||||
* @param sonar the ultrasonic sensor
|
* @param sensor the ultrasonic sensor port
|
||||||
*/
|
*/
|
||||||
//% help=input/ultrasonic/distance
|
//% help=input/ultrasonic/distance
|
||||||
//% block="%sonar|distance"
|
//% block="%sensor|distance"
|
||||||
//% blockId=sonarGetDistance
|
//% blockId=sonarGetDistance
|
||||||
//% parts="ultrasonic"
|
//% parts="ultrasonic"
|
||||||
//% blockNamespace=input
|
//% blockNamespace=input
|
||||||
//% weight=65 blockGap=8
|
//% weight=65 blockGap=8
|
||||||
//% group="Sonar"
|
//% group="Ultrasonic sensor"
|
||||||
distance() {
|
distance() {
|
||||||
// it supposedly also has an inch mode, but we stick to mm
|
// it supposedly also has an inch mode, but we stick to mm
|
||||||
this._setMode(0)
|
this._setMode(0)
|
||||||
@ -28,15 +28,15 @@ namespace input {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic 1"
|
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||||
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
export const ultrasonic1: UltraSonicSensor = new UltraSonicSensor(1)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic 1"
|
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||||
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
export const ultrasonic2: UltraSonicSensor = new UltraSonicSensor(2)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic 1"
|
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||||
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
export const ultrasonic3: UltraSonicSensor = new UltraSonicSensor(3)
|
||||||
|
|
||||||
//% fixedInstance whenUsed block="ultrasonic 1"
|
//% fixedInstance whenUsed block="ultrasonic sensor 1"
|
||||||
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
export const ultrasonic4: UltraSonicSensor = new UltraSonicSensor(4)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user