VNG bot battle
Dependencies: BLE_API mbed nRF51822
SensorController.h
00001 /* 00002 * SensorController.h 00003 * 00004 * Created on: Aug 26, 2016 00005 * Author: tanpt 00006 */ 00007 00008 #ifndef SENSORCONTROLLER_H_ 00009 #define SENSORCONTROLLER_H_ 00010 00011 #include "common.h" 00012 00013 //// Sensor 00014 #define SENSOR_NOISE 5 00015 00016 class SensorController { 00017 public: 00018 SensorController(); 00019 ~SensorController(); 00020 00021 enum SensorState { 00022 SENSOR_ON = 0, SENSOR_OFF = 1 00023 }; 00024 00025 void init(); 00026 00027 uint16_t distanceSensorFront(); 00028 uint16_t distanceSensorRight(); 00029 uint16_t distanceSensorLeft(); 00030 uint8_t frontRightSensor(); 00031 uint8_t frontLeftSensor(); 00032 uint8_t backSensor(); 00033 00034 private: 00035 00036 static AnalogIn sensorDistanceFront_; 00037 static AnalogIn sensorDistanceRight_; 00038 static AnalogIn sensorDistanceLeft_; 00039 static DigitalIn sensorFrontRight_; 00040 static DigitalIn sensorFrontLeft_; 00041 static DigitalIn sensorBack_; 00042 static DigitalIn sensorIR_; 00043 }; 00044 00045 #endif /* SENSORCONTROLLER_H_ */
Generated on Fri Aug 5 2022 18:35:57 by
1.7.2