An embedded server sending sensor information over the network to a remote client side process parsing the data
Dependencies: EthernetInterface NTPClient TimeInterface WebSocketClient mbed-rtos mbed ST_Events-old
Diff: data_logger.h
- Revision:
- 3:221997836268
- Parent:
- 2:5c9125d3ddae
- Child:
- 6:b59d85d0e67d
- Child:
- 7:e9d4a4972e50
--- a/data_logger.h Fri Jul 21 01:56:38 2017 +0000 +++ b/data_logger.h Sat Sep 16 21:05:00 2017 +0000 @@ -7,14 +7,20 @@ #include "mbed_events.h" #define SERVER_PORT 7 #define RATE 10000 +#define NOMINAL_R 350 //In Ohms +#define GAUGE_FACTOR 2.1 +#define CURRENT 2 //In amps -int data = 711; //Example test data to be sent across the network +int data = 711; //Example test data to be sent across the network int i = 0; -char appbuffer[105]; //Application buffer -int len = 105; //Length of the buffer +char appbuffer[105]; //Application buffer +int len = 105; //Length of the buffer float cycle_time; int p_press = 0; int id_press = 0; +float p_strain = 0; +float id_strain = 0; + //int samples[]; @@ -24,5 +30,10 @@ void cycle_time_isr_fall(void); //ISR on the falling edge of the digital input stopping the cycle timer and restarting the periodic reporting thread -void pressure_report(void); -//sends the XML markup payload with idle hydraulic line pressure data at a prescribed rate +void idle_report(void); +//sends the XML markup payload while the machine is idle + +float strainCalc(void); +//Calculate the strain from the analog input signal received from the strain gauge + +