I am hoping to use only two signal data lines of 3 sensors and send them one after the other using RS485. This was done to check whether it can be sent to an order first. Can you correct it?
int enablePin = 8;
int pushval = A0;
int pushva2 = A1;
int pushva3 = A2;
int potval =0 ;
int potva = 0;
int i =0;
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 16,2);
void setup()
{
Serial.begin(9600); // initialize serial at baudrate 9600:
pinMode(enablePin, OUTPUT);
pinMode(pushval,INPUT);
pinMode(pushva2,INPUT);
pinMode(pushva3,INPUT);
digitalWrite(enablePin, HIGH); // (always high as Master Writes data to Slave)
lcd.init();
lcd.backlight();
lcd.print("Hello, world!");
delay(1000);
lcd.clear();
}
void loop()
{
// int potval = analogRead(pushval);
// int potva2 = analogRead(pushva2);
// int potva3 = analogRead(pushva3);
for(i=0; i<3; i++){
if(i==0)
int potva = analogRead(pushval);
Serial.println(potva);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(potva);
if(i==1)
int potva = analogRead(pushval);
Serial.println(potva);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(potva);
if(i==2)
int potva = analogRead(pushval);
Serial.println(potva);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(potva);
delay(300);
}
}





