ADD preparation for tests

This commit is contained in:
fastium
2025-01-04 16:41:02 +01:00
parent 3a3d27f93e
commit 55a6594646
6 changed files with 55 additions and 18 deletions

View File

@@ -1,21 +1,37 @@
// Copyright 2022 Haute école d'ingénierie et d'architecture de Fribourg
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/****************************************************************************
* @file speedometer_device.cpp
* @author Serge Ayer <serge.ayer@hefr.ch>
*
* @brief WheelCounterDevice implementation (static scheduling)
*
* @date 2023-08-20
* @version 1.0.0
***************************************************************************/
#include "sensor_device.hpp"
namespace bike_computer {
SensorDevice::SensorDevice() : _hdc1000(I2C_SDA, I2C_SCL, STMOD_11)
{}
SensorDevice::SensorDevice() : _hdc1000(I2C_SDA, I2C_SCL, STMOD_11) {}
bool SensorDevice::init() {
return this->_hdc1000.probe();
}
bool SensorDevice::init() { return this->_hdc1000.probe(); }
float SensorDevice::readTemperature(void) {
return this->_hdc1000.getTemperature();
}
float SensorDevice::readTemperature(void) { return this->_hdc1000.getTemperature(); }
float SensorDevice::readHumidity(void) {
return this->_hdc1000.getHumidity();
}
} // bike_computer
float SensorDevice::readHumidity(void) { return this->_hdc1000.getHumidity(); }
} // namespace bike_computer