using icons on drop downs

This commit is contained in:
Peli de Halleux
2017-12-06 22:34:11 -08:00
parent ab13cb9047
commit 162e437527
10 changed files with 154 additions and 45 deletions

View File

@ -27,6 +27,8 @@ namespace sensors {
//% block="`icons.gyroSensor` %sensor|angle"
//% blockId=gyroGetAngle
//% parts="gyroscope"
//% sensor.fieldEditor="imagedropdown"
//% sensor.fieldOptions.columns=4
//% blockNamespace=sensors
//% weight=65 blockGap=8
//% group="Gyro Sensor"
@ -43,6 +45,8 @@ namespace sensors {
//% block="`icons.gyroSensor` %sensor|rotation rate"
//% blockId=gyroGetRate
//% parts="gyroscope"
//% sensor.fieldEditor="imagedropdown"
//% sensor.fieldOptions.columns=4
//% blockNamespace=sensors
//% weight=65 blockGap=8
//% group="Gyro Sensor"
@ -51,16 +55,16 @@ namespace sensors {
return this.getNumber(NumberFormat.Int16LE, 0)
}
}
//% fixedInstance whenUsed block="1"
//% fixedInstance whenUsed block="1" jres=icons.port1
export const gyro1: GyroSensor = new GyroSensor(1)
//% fixedInstance whenUsed block="2" weight=95
//% fixedInstance whenUsed block="2" weight=95 jres=icons.port2
export const gyro2: GyroSensor = new GyroSensor(2)
//% fixedInstance whenUsed block="3"
//% fixedInstance whenUsed block="3" jres=icons.port3
export const gyro3: GyroSensor = new GyroSensor(3)
//% fixedInstance whenUsed block="4"
//% fixedInstance whenUsed block="4" jres=icons.port4
export const gyro4: GyroSensor = new GyroSensor(4)
}