Skip to content

Commit

Permalink
Update ArduinoPollDemo.ino
Browse files Browse the repository at this point in the history
  • Loading branch information
atc1441 authored May 29, 2021
1 parent a5a661b commit e8bfe63
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions ArduinoPollDemo/ArduinoPollDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ void loop() {
float ac_current = (rx_buffer[21] << 8 | rx_buffer[22]) / 100;
float ac_power = ac_voltage * ac_current;

/* union byte_to_float_union {
byte byte_in[4];
float float_out;
} byte_to_float;
byte_to_float.byte_in[0] = rx_buffer[13];
byte_to_float.byte_in[1] = rx_buffer[12];
byte_to_float.byte_in[2] = rx_buffer[11];
byte_to_float.byte_in[3] = rx_buffer[10];
*/
const uint32_t tempTotal = rx_buffer[10] << 24 | rx_buffer[11] << 16 | rx_buffer[12] << 8 | (rx_buffer[13] & 0xFF);
float power_gen_total = *((float*)&tempTotal);

Expand Down

0 comments on commit e8bfe63

Please sign in to comment.