NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
char ReadSensorEMeter ( const byte &  port,
float &  vIn,
float &  aIn,
float &  vOut,
float &  aOut,
int &  joules,
float &  wIn,
float &  wOut 
)
inline

Read the LEGO EMeter values.

Read all the LEGO EMeter register values. They must all be read at once to ensure data coherency.

Parameters
portThe port to which the LEGO EMeter sensor is attached. See the Input port constants group. You may use a constant or a variable.
vInInput voltage
aInInput current
vOutOutput voltage
aOutOutput current
joulesThe number of joules stored in the EMeter
wInThe number of watts generated
wOutThe number of watts consumed
Returns
A status code indicating whether the read completed successfully or not. See CommLSReadType for possible result values.
Examples:
ex_ReadSensorEMeter.nxc.