7 package com.google.appinventor.components.runtime;
22 static class SensorValue<T> {
25 SensorValue(
boolean valid, T value) {
31 static final int SENSOR_TYPE_NO_SENSOR = 0x00;
32 static final int SENSOR_TYPE_SWITCH = 0x01;
33 static final int SENSOR_TYPE_TEMPERATURE = 0x02;
34 static final int SENSOR_TYPE_REFLECTION = 0x03;
35 static final int SENSOR_TYPE_ANGLE = 0x04;
36 static final int SENSOR_TYPE_LIGHT_ACTIVE = 0x05;
37 static final int SENSOR_TYPE_LIGHT_INACTIVE = 0x06;
38 static final int SENSOR_TYPE_SOUND_DB = 0x07;
39 static final int SENSOR_TYPE_SOUND_DBA = 0x08;
40 static final int SENSOR_TYPE_CUSTOM = 0x09;
41 static final int SENSOR_TYPE_LOWSPEED = 0x0A;
42 static final int SENSOR_TYPE_LOWSPEED_9V = 0x0B;
44 static final int SENSOR_MODE_RAWMODE = 0x00;
45 static final int SENSOR_MODE_BOOLEANMODE = 0x20;
46 static final int SENSOR_MODE_TRANSITIONCNTMODE = 0x40;
47 static final int SENSOR_MODE_PERIODCOUNTERMODE = 0x60;
48 static final int SENSOR_MODE_PCTFULLSCALEMODE = 0x80;
49 static final int SENSOR_MODE_CELSIUSMODE = 0xA0;
50 static final int SENSOR_MODE_FAHRENHEITMODE = 0xC0;
51 static final int SENSOR_MODE_ANGLESTEPMODE = 0xE0;
52 static final int SENSOR_MODE_MASK_SLOPE = 0x1F;
53 static final int SENSOR_MODE_MASK_MODE = 0xE0;
55 private String sensorPortLetter;
68 @
SimpleProperty(description =
"The sensor port that the sensor is connected to.",
71 return sensorPortLetter;
76 public abstract void SensorPort(String sensorPortLetter);
79 String functionName =
"SensorPort";
83 }
catch (IllegalArgumentException e) {
89 this.sensorPortLetter = sensorPortLetter;