implement gyroskop
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file menuSensorData.cpp
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-04
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#include "menuSensorData.h"
|
||||
|
||||
MenuSensorData::MenuSensorData(SensorData* sensorData) :
|
||||
MenuInformationSites(4) {
|
||||
this->sensorData = sensorData;
|
||||
}
|
||||
|
||||
void MenuSensorData::printPage() const {
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
|
||||
switch (this->getCurrentPage()) {
|
||||
case 0:
|
||||
lineOne = "Yaw:";
|
||||
lineTwo.concat(this->sensorData->getGyroData()[0]);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
lineOne = "Pitch:";
|
||||
lineTwo.concat(this->sensorData->getGyroData()[1]);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
lineOne = "Roll:";
|
||||
lineTwo.concat(this->sensorData->getGyroData()[2]);
|
||||
break;
|
||||
|
||||
default:
|
||||
this->printDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
this->print(lineOne, lineTwo);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* @file menuSensorData.h
|
||||
* @author Alexander Klein (alex@kleiax.de)
|
||||
* @brief
|
||||
* @version 0.1
|
||||
* @date 2023-09-04
|
||||
*
|
||||
* @copyright Copyright (c) 2023
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MENU_SENSOR_DATA_H
|
||||
#define MENU_SENSOR_DATA_H
|
||||
|
||||
#include "menuInformationSites.h"
|
||||
#include "sensorData.h"
|
||||
|
||||
class MenuSensorData : public MenuInformationSites {
|
||||
public:
|
||||
MenuSensorData(SensorData* SensorData);
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
|
||||
SensorData* sensorData;
|
||||
};
|
||||
|
||||
#endif //MENU_SENSOR_DATA_H
|
||||
Reference in New Issue
Block a user