-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSensorMessage.cpp
More file actions
44 lines (40 loc) · 1.15 KB
/
SensorMessage.cpp
File metadata and controls
44 lines (40 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* @file SensorMessage.cpp
* @author Brian Almaguer (brianharo2000@gmail.com)
* @brief Library for flashing SensorMessage code.
* @version 0.1
* @date 2021-02-26
*
* @copyright Copyright (c) 2021 LiquidPropulsionGroup
*
*/
#include "Arduino.h"
#include "SensorMessage.h"
/**
* @brief Construct a new Sensor Message:: Sensor Message object
*
* @param startCount
*/
SensorMessage::SensorMessage(int startCount)
{
count = startCount;
}
/**
* @brief Builds and sends a serial information.
*
*/
void SensorMessage::Send()
{
this->SetBuffer();
Serial.println(buff);
}
/**
* @brief Set the Buffer object
*
*/
void SensorMessage::SetBuffer()
{
sprintf(buff, "{\"PT_HE\":%hu,\"PT_Purge\":%hu,\"PT_Pneu\":%hu,\"PT_FULE_PV\":%hu,\"PT_LOX_PV\":%hu,\"PT_FUEL_INJ\":%hu,\"PT_CHAM\":%hu,\"TC_FUEL_PV\":%hu,\"TC_LOX_PV\":%hu,\"TC_LOX_Valve_Main\":%hu,\"RC_LOX_Level\":%hu,\"FT_Thrust\":%hu}",
this->PT_HE, this->PT_Purge, this->PT_Pneu, this->PT_FULE_PV, this->PT_LOX_PV, this->PT_FUEL_INJ, this->PT_CHAM, this->TC_FUEL_PV, this->TC_LOX_PV, this->TC_LOX_Valve_Main, this->RC_LOX_Level, this->FT_Thrust);
this->count++;
}