Sensors Simple API

Sensors#

What do you want to measure?

Simple API#

APIDescriptionDetails
getStatus()Gets the status of any generic GPIO pinRead More
getAdc()Get the Adc value from the sensorRead More
getLux()Get the Lux value from the sensorRead More
getCm()Gets the distance from supported sensorsRead More
getBpm()Gets the Heart rate from supported sensorsRead More
getLph()Gets the Flow from supported sensorsRead More
motionStatus()Get the status of the motion sensorRead More
proxmityStatus()Get status from the proximity sensorRead More
touchStatus()Get status from the touch sensorRead More
lightStatus()Get status from the light blocking sensorRead More
tiltStatus()Get status from the light blocking sensorRead More

Detailed Description#


getAdc()#

Description : Gets the status of any generic GPIO pin

Parameters

  • channel ADC Channel number

Return-type : int16_t

Returns : int16_t digital value for analog reading on Success and -1 on Failure

Usage :

int16_t value = getAdc(1);

Supported ADC's#


getBpm()#

Description : Gets the Heart rate from supported sensors.

Return-type : int16_t

Returns : int16_t The Heart rate in bpm.

Usage :

int16_t bpm = getBpm();

getCm()#

Description : Gets the distance from supported sensors.

Return-type : int16_t

Returns : int16_t The distance in cm.

Usage :

int16_t cm = getCm();


getLph()#

Description : Gets the Flow from supported sensors.

Return-type : int16_t

Returns : int16_t The Flow in Liters per hour.

Usage :

int16_t cm = getLph();

getLux()#

Description : Get the Lux value from the sensor.

Return-type : int16_t

Returns : int16_t the lux value on Success and -1 on Failure.

Usage :

int16_t cm = getLux();

getStatus()#

Description : Gets the status of any generic GPIO pin.

Parameters

  • phyPin The phy pin

Return-type : int8_t

Returns : int8_t GPIO pin values on Success and -1 on Failure

Usage :

int value = getStatus(40);

lightStatus()#

Description : Get status from the light blocking sensor.

Return-type : int8_t

Returns : 1 if light detected else 0, -1 if error

Usage :

int value = lightStatus();

motionStatus()#

Description : Get the status of the motion sensor.

Return-type : int8_t

Returns : 1 if motion detected else 0, -1 if error

Usage :

int value = motionStatus();

proxmityStatus()#

Description : Get status from the proximity sensor.

Return-type : int8_t

Returns : 1 if proximity detected else 0, -1 if error

Usage :

int value = proxmityStatus();

tiltStatus()#

Description : Get status from the tilt sensor.

Return-type : int8_t

Returns : 1 if tilt detected else 0, -1 if error

Usage :

int value = tiltStatus();

touchStatus()#

Description : Get status from the touch sensor.

Return-type : int8_t

Returns : 1 if touch detected else 0, -1 if error

Usage :

int value = touchStatus();

Facing errors with the component?#