Hi my arduino Famillies i developpe somme tehnologie
i try to get weight of some product and show it on a LCD screen and send it to a server using Ethernet shield arduino
I get some problem when i test how separatelly everything work when i try to combine all script together i see anything on the screen
this my code
void setup()
{
Serial.begin(9600);
//For Load Cell
costumeLoadcell();
//For HTTP
serializedhcp();
}
void loop()
{
configurationLoopLoadcell();
// configurationLoopHttp();
}
void costumeLoadcell()
{
Serial.println("Loadcell calculate");
Serial.begin(9600);
Serial.println("HX711 scale demo");
scale.set_scale(-99999.29999); //This value is obtained by using the SparkFun_HX711_Calibration sketch
scale.tare(); //Assuming there is no weight on the scale at start up, reset the scale to 0
Serial.println("Readings:");
lcd.begin(16, 2);
}
void serializedhcp()
{
//On démarre le shield Ethernet SANS adresse IP (donc donnée via DHCP)
Serial.println("TEST JSON HTTP");
erreur = Ethernet.begin(mac);
if (erreur == 0)
{
Serial.println("Parametrage avec ip fixe...");
Ethernet.begin(mac, ip, dns2, gateway, netmask);
}
Serial.println("Init...");
//Donne une seconde au shield pour s'initialiser
//delay(1000);
Serial.println("Ready!");
}
void configurationLoopLoadcell()
{
Serial.print("Reading: ");
Serial.print(scale.get_units(), 1); //scale.get_units() returns a float
Serial.print(" lbs"); //You can change this to kg but you'll need to refactor the calibration_factor
Serial.println();
lcd.setCursor(0, 1);
lcd.print("Weight[l] :");
lcd.print(scale.get_units(), 1);
}
if i comment the :serializedhcp() method i can see i weigh i put on the balance when i uncomment the method nothing work;