NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
Input module

Constants and functions related to the Input module. More...

Modules

 Input module constants
 Constants that are part of the NXT firmware's Input module.
 
 Input module functions
 Functions for accessing and modifying input module features.
 
 Input module types
 Types used by various input module functions.
 

Detailed Description

Constants and functions related to the Input module.

The NXT input module encompasses all sensor inputs except for digital I2C (LowSpeed) sensors.

There are four sensors, which internally are numbered 0, 1, 2, and 3. This is potentially confusing since they are externally labeled on the NXT as sensors 1, 2, 3, and 4. To help mitigate this confusion, the sensor port names S1, S2, S3, and S4 have been defined. See Input port constants. These sensor names may be used in any function that requires a sensor port as an argument. Alternatively, the NBC port name constants IN_1, IN_2, IN_3, and IN_4 may also be used when a sensor port is required, although this is not recommended. See NBC Input port constants. Sensor value names SENSOR_1, SENSOR_2, SENSOR_3, and SENSOR_4 have also been defined. These names may also be used whenever a program wishes to read the current value of the analog sensor:

x = SENSOR_1; // read sensor and store value in x