# Device API

### Device Information

#### `getDeviceName()`

Returns the device name.

#### `getManufacturer()`

Returns the sensor manufacturer (AMS).

#### `setI2cAddress(I2cAddr newAddress)`

Sets a new I2C address for the device.

#### `getI2cAddress()`

Gets the current I2C address.

#### `doInitialize()`

Performs internal initialization and verifies sensor communication.

### Color & Light Functions

#### `classifyColor()`

Classifies perceived color using RGB thresholds. Returns:\
`"Red"`, `"Green"`, `"Blue"`, `"Yellow"`, `"Cyan"`, `"Magenta"`, `"White"`, `"Black"`, `"Unknown"`.

#### `argb()`

Returns packed 32-bit Android-style ARGB color.

#### `getNormalizedColors()`

Returns normalized alpha, red, green, and blue in \[0,1] range.

#### `alpha()`

Reads the clear (ambient) light channel.

#### `getRawLightDetected()`

Returns normalized ambient light intensity.

#### `getLightDetected()`

Returns normalized light detection (same as above).

#### `getRawLightDetectedMax()`

Returns max possible raw light value (65535).

#### `red()`

Reads the red channel.

#### `green()`

Reads the green channel.

#### `blue()`

Reads the blue channel.

### Distance & Proximity Functions

#### `getDistance(DistanceUnit unit)`

Returns calibrated proximity-based distance in specified units.

#### `getProximity()`

Returns raw proximity value (0–255).

#### `setProximityGain(ProximityGain gain)`

Sets proximity gain (1x, 2x, 4x, 8x).

#### `setProximityLedPulses(int pulses)`

Sets number of IR LED pulses (1–64).

#### `setProximityLedPulseLength(ProximityPulseLength pulseLength)`

Sets IR LED pulse duration (4µs, 8µs, 16µs, 32µs).

#### `configureProximitySettings(ProximityGain gain, int pulses, ProximityPulseLength pulseLength)`

Configures gain, pulse count, and pulse length in one call.

### Utility

#### `String status()`

Returns connection status string.
