#ifndef IR_SENSOR_H_ #define IR_SENSOR_H_ #include "includes.h" #define NUM_SENSORS 5 /** * Initialize the IR sensor module. */ void ir_sensor_init(); /** * Tells the sensor module to start sampling the indicated sensors. */ void ir_sensor_start_sampling(uint8_t desired_sensors); /** * Returns true if the sensor has a sample for the given sensor. */ bool ir_sensor_has_sample(uint8_t sensor_index); /** * Returns a bitmask indicating which IR sensors have * received samples. * * Basically, this is ir_sensor_has_sample, but for ALL of the * sensors. */ uint8_t ir_sensor_sample_status(); /** * After you call this method, ir_sensor_has_sample() will return * false until the next sample is read for the given sensor. */ void ir_sensor_watch(uint8_t sensor_index); /** * Returns the most recently read sensor value. */ uint16_t ir_sensor_get_last_value(uint8_t sensor_index); #endif /*IR_SENSOR_H_*/