So I'm currently working on a project with the Arduino Uno and a display. This is my code:
//cluster_fuck.ino
//
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "GetServerList.h"
//#include "GetServerList.h";
bool startupdone = false;
// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
lcd.begin();
// Turn on the blacklight.
lcd.backlight();
//startup();
}
void startup() {
if (startupdone == true) {
checkeach();
}
// Robojax code for LCD with I2C
// initialize the LCD,
digitalWrite(13, HIGH);
delay(200);
digitalWrite(13, LOW);
lcd.setCursor(0, 0);
lcd.print("8888888888888888");
lcd.setCursor(0, 1);
lcd.print("8888888888888888");
delay(2000);
lcd.clear();
bootscreen();
}
void bootscreen() {
//Title Screen
lcd.setCursor(0, 0);
lcd.print("Cluster Fuck 1.1");
lcd.setCursor(0, 1);
lcd.print("Cluster Control");
delay(5000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" Starting Up");
lcd.setCursor(0, 1);
lcd.print(" Please Wait...");
delay(5000);
checkeach();
}
void loop() {
startup();
}
void checkeach() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("S" + serverId + " " + serverName + " C"+ clusterId); //Change This
lcd.setCursor(0, 1);
lcd.print("IP:" + serverIP); //Change This
lcd.setCursor(0, 1);
delay(5000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("S" + serverId + " " + serverName + " C" + clusterId); //Change This
lcd.setCursor(0, 1);
lcd.print(serverStatusCode + " - " + serverStatusName); //Change This
delay(5000);
checkeach();
}
The file below gets the server data files:
//getserverlist.h
//
#include "serverdata/1.h"
#include "serverdata/2.h"
Each of the serverdata header files contain the following data:
//1.h
//
String serverId = "1";
String clusterId = "1";
String serverName = "Web Server";
String serverIP = "192.168.1.234";
String serverStatusCode = "E0";
String serverStatusName = "No Err";
I'm trying to make it to where it'll loop through each header file in the serverdata directory.
However, the problem I'm having is:
note: 'String {name of string}' previously declared here
How can I make this happen?
