#define MAX485_DE 3
#define MAX485_RE_NEG 2
void preTransmission()
{
digitalWrite(MAX485_RE_NEG, 1);
digitalWrite(MAX485_DE, 1);
}
void postTransmission()
{
digitalWrite(MAX485_RE_NEG, 0);
digitalWrite(MAX485_DE, 0);
}
void setup()
{
pinMode(MAX485_RE_NEG, OUTPUT);
pinMode(MAX485_DE, OUTPUT);
digitalWrite(MAX485_RE_NEG, 0);
digitalWrite(MAX485_DE, 0);
Serial.begin(115200);
}
bool state = true;
void loop()
{
uint8_t result;
uint16_t data[6];
state = !state;
{
Serial.print("Vbatt: ");
Serial.print("Vload: ");
Serial.print("Pload: ");
}
delay(1000);
}