|
AI2 Component
(Version nb184)
|
Go to the documentation of this file.
6 package com.google.appinventor.components.runtime;
33 @
SimpleProperty(description =
"The sensor port that the sensor is connected to.",
48 String functionName =
"SensorPort";
52 protected final void setSensorPort(String functionName, String sensorPortLetter) {
55 }
catch (IllegalArgumentException e) {
66 if (layer < 0 || layer > 3 || no < 0 || no > 3 || mode < -1 || mode > 7)
67 throw new IllegalArgumentException();
82 byte[] reply =
sendCommand(functionName, command,
true);
84 return (
int) reply[1];
95 if (layer < 0 || layer > 3 || no < 0 || no > 3 || mode < -1 || mode > 7)
96 throw new IllegalArgumentException();
110 byte[] reply =
sendCommand(functionName, command,
true);
114 return (
double) ((Float) values[0]);
-*- mode: java; c-basic-offset: 2; -*-
static final String PROPERTY_TYPE_LEGO_EV3_SENSOR_PORT
final double readInputSI(String functionName, int layer, int no, int type, int mode)
static final String DEFAULT_SENSOR_PORT
final int readInputPercentage(String functionName, int layer, int no, int type, int mode)
static byte[] encodeDirectCommand(byte opcode, boolean needReply, int globalAllocation, int localAllocation, String paramFormat, Object... parameters)
LegoMindstormsEv3Sensor(ComponentContainer container, String logTag)
static final int ERROR_EV3_INVALID_REPLY
final void setSensorPort(String functionName, String sensorPortLetter)
final int sensorPortLetterToPortNumber(String letter)
static Object[] unpack(String format, byte[] bytes)
Copyright 2009-2011 Google, All Rights reserved.
final byte[] sendCommand(String functionName, byte[] command, boolean doReceiveReply)
void SensorPort(String sensorPortLetter)
static final int ERROR_EV3_ILLEGAL_SENSOR_PORT
final String portNumberToSensorPortLetter(int portNumber)