fix false readings

This commit is contained in:
2022-05-24 19:08:20 +02:00
parent 17ad372e86
commit 105b208bed

View File

@@ -3,7 +3,7 @@
#include <util/delay.h>
#include "modbus.h"
#define HIGH_LOW_CYCLE_TIME 1
#define HIGH_LOW_CYCLE_TIME 10
uint16_t holdingRegisters[4];
@@ -70,6 +70,9 @@ void modbusGet(void) {
PORTC ^= 1 << 1;
// _delay_ms(10);
// PORTC &= ~(1 << 1);
while(PINB & (1<<4)); // wait for data ready
uint32_t tmp = HX711_get_data(3, 4, 128);
//int32_t tmp = -1000;
holdingRegisters[0] = tmp & 0xFFFF;