22 lines
		
	
	
		
			392 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			392 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #include "sensor_device.hpp"
 | |
| 
 | |
| namespace bike_computer {
 | |
| 
 | |
| SensorDevice::SensorDevice() : _hdc1000(I2C_SDA, I2C_SCL, STMOD_11) 
 | |
| {}
 | |
| 
 | |
| bool SensorDevice::init() {
 | |
|     return this->_hdc1000.probe();
 | |
| }
 | |
| 
 | |
| float SensorDevice::readTemperature(void) {
 | |
|     return this->_hdc1000.getTemperature();
 | |
| }
 | |
| 
 | |
| float SensorDevice::readHumidity(void) {
 | |
|     return this->_hdc1000.getHumidity();
 | |
| }
 | |
| 
 | |
| } // bike_computer
 | |
| 
 |