Clean up temperature assignment when sending data
This commit is contained in:
parent
e62c361970
commit
0d5d439ce1
@ -62,16 +62,10 @@ int main(void)
|
|||||||
|
|
||||||
void send_sensor_data(const int32_t *distance_in_cm)
|
void send_sensor_data(const int32_t *distance_in_cm)
|
||||||
{
|
{
|
||||||
double temp;
|
|
||||||
|
|
||||||
temp = ds18b20_gettemp();
|
|
||||||
/* if (temp >= 23) */
|
|
||||||
|
|
||||||
|
|
||||||
// Prepare the data to be sent
|
// Prepare the data to be sent
|
||||||
memset(&tx_data, 0, sizeof(data_packet_t));
|
memset(&tx_data, 0, sizeof(data_packet_t));
|
||||||
tx_data.distance = *distance_in_cm;
|
tx_data.distance = *distance_in_cm;
|
||||||
tx_data.temp = temp;
|
tx_data.temp = ds18b20_gettemp();
|
||||||
memcpy(tx_raw, &tx_data, sizeof(data_packet_t));
|
memcpy(tx_raw, &tx_data, sizeof(data_packet_t));
|
||||||
|
|
||||||
nrf24_send(tx_raw);
|
nrf24_send(tx_raw);
|
||||||
|
Loading…
Reference in New Issue
Block a user