Hello
I did not played with this Arduino program since January. The code use to work, but now I'm receiving this error. "No such file or librairies"
The missing librairie is HX711.h. I'm trying to add it using the "Include Librairies" but still not working.
I did start Arduino.exe as an administrator
Can't understand why the libraries is missing nor why I can't reinstall it.
Any help appreciated
Martin
#include "HX711.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <Ethernet.h>
LiquidCrystal_I2C lcd(0x21, 20, 4); // set the LCD address to 0x27 for a 16 chars and 2 line display
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // Be sure this address is unique in your network
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);
IPAddress myDns(192, 168, 0, 1);
//http://api.pushingbox.com/pushingbox?devid=v28D0DDB70C514E5&date=20191222&heure=1025&temp=26&client=4321&saveur1=99&saveur2=88&saveur3=77&saveur4=66&saveur5=-2
char DEVID[]= "v28D0DDB70C514E5";
char serverName[] = "api.pushingbox.com";
EthernetClient client;
// Debug mode
boolean DEBUG = true;
int calibration = 15000;
#define calibration_factor calibration //This value is obtained using the SparkFun_HX711_Calibration sketch 5VDC
//#define calibration_factor 15350.0 //This value is obtained using the SparkFun_HX711_Calibration sketch 3.3 VDZ
#define DOUT 3
#define CLK 2
byte _data; //KeySwitch
byte aButton;//KeySwitch
unsigned long previousMillis = 0;
const int interval = 1000;
long Poids;
//à changer plus tard.
long date = 20191222;
int heure = 1212;
int NumClient = 123;
long saveur1,saveur2,saveur3,saveur4,saveur5;
HX711 scale;
void setup() {
Serial.begin(9600);
Serial.println("step1");
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// no point in carrying on, so do nothing forevermore:
while(true);
}
else{
Serial.println("Ethernet ready");
// print the Ethernet board/shield's IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println ("done");
//Key SwitchWire.begin();
Wire.beginTransmission(0x20);
Wire.write(0xff); // put a high level on pins
Wire.endTransmission();
// Serial.println("HX711 scale demo");
scale.begin(DOUT, CLK);
scale.set_scale (calibration); //(calibration_factor); //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
lcd.init();
lcd.setCursor(0, 0);
lcd.print("Balance: ");
//Serial.println("Readings:");
}
void loop() {
int Button();
aButton = Button();
if (aButton == 1) {
lcd.setCursor(0, 1);
lcd.print("TARE");
scale.tare();
// delay(1000);
lcd.setCursor(0, 1);
lcd.print(" ");
}
if (aButton == 3) {sendToPushingBox(DEVID);}
//if (aButton == 4) {Serial.println(aButton);}
//if (aButton == 5) {
if (aButton == 6) {
(calibration = calibration + 100);
}
//Call reset
if (aButton == 7) {
lcd.setCursor(0, 2);
lcd.print("Reset");
//delay(1000);
softReset();
}
aButton == 10;
//____________________
//Serial.print("Reading: ");
//Serial.print(scale.get_units(), 2); //scale.get_units() returns a float
//Serial.print(" kg"); //You can change this to kg but you'll need to refactor the calibration_factor
// Serial.println();
lcd.setCursor(0, 3);
lcd.print(scale.get_units(10), 2);
lcd.print(" kg ");
}
//Function______________________________________________
void sendToPushingBox(char devid[]){
client.stop();
if(DEBUG){Serial.println("connecting...");}
if (client.connect(serverName, 80)) {
if(DEBUG){Serial.println("connected");}
if(DEBUG){Serial.println("sendind request");}
client.print("GET /pushingbox?devid=");
client.print(devid);
client.println(" HTTP/1.1");
client.print("Host: ");
client.println(serverName);
client.println("User-Agent: Arduino");
client.println();
}
else {
if(DEBUG){Serial.println("connection failed");}
}
}
byte Button() {
byte _data;
const int debounce = 225;
byte aButton_ = (0);
Wire.begin();
Wire.requestFrom(0x20, 1);
if (Wire.available()) {
_data = Wire.read();
if (_data < 255) {
delay(debounce);
if (_data == 254) aButton_ = 1;
if (_data == 251) aButton_ = 3;
if (_data == 247) aButton_ = 4;
if (_data == 239) aButton_ = 5;
if (_data == 223) aButton_ = 6;
if (_data == 191) aButton_ = 7;
return aButton_ ;
}
}
}
//Reset
void softReset() {
asm volatile (" jmp 0");
}