Hello,
I have a working system that has one control card and many clients. Control card sends some commands over serial protocol and clients gets the commands. Every thing is working fine.
I'm attaching multiple devices by using max485, also clients uses PIC 16F628A
Today, I wanted to attach an arduino board to visualize the commands. Arduino board is connecting the to the system as the other clients. And has an LCD that shows the commands. Simply reads serial and writes to LCD.
When I connect the arduino board other clients stops working. When I unplug or off the arduino device system starts working again.
I'm connecting arduino board as the same as other clients.
I have attached a connection schema and you can see my arduino boards source code:
What I am doing wrong?
#include <Wire.h>
#include <LiquidCrystal_I2C.h> // Using version 1.2.1
#include <Timer.h>
Timer t;
// The LCD constructor - address shown is 0x27 - may or may not be correct for yours
// Also based on YWRobot LCM1602 IIC V1
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup()
{
Serial.begin(2400);
while (!Serial) {
}
lcd.begin(16,2); // sixteen characters across - 2 lines
lcd.backlight();
// first character - 1st line
lcd.setCursor(0,0);
lcd.print("Hello World!");
lcd.setCursor(0,1);
lcd.print("-------");
t.every(5000,resetCursor);
}
void resetCursor(){
lcd.setCursor(0,0);
}
void loop()
{
if (Serial.available()) {
lcd.print(Serial.read());
lcd.print("-");
}
t.update();
}
