- Sat May 28, 2016 1:36 am
#48148
Hi. I've been trying to get the code examples above to run on an esp 8266 12e without luck.
I keep getting the following error. Any insights on what may be causing it? I've tried the JP scale example among others but none work. In the below example there is as follows. Appreciate any help.
ets jan8 2013, rst cause:2, )boot mode: (3,6)
Code example below:
#include <Wire.h>
#include "HX711.h"
#define NB_ECHANTILLON 10
uint32 index_moyenne=0;
HX711 scale(12, 14); // HX711.DOUT = GPIO12 / HX711.PD_SCK = GPIO14
float resultat[NB_ECHANTILLON];
void setup() {
Serial.begin(115200);
Serial.println("Test HX711");
scale.read();
yield(); // Redonne la main à l'ESP8266
/*
* Le nombre ci dessous permet de calibrer la balance. Pour l'obtenir, voir le fichier README de la bibliothèque HX711
*/
scale.set_scale(20108.1f);
scale.tare();
yield();
}
void loop() {
float poids,total;
uint8 n;
poids=scale.get_units(10);
resultat[index_moyenne++]=poids;
index_moyenne %= NB_ECHANTILLON;
total=0;
for(n=0;n<NB_ECHANTILLON;n++){
total+=resultat[n];
}
Serial.print(poids);
Serial.print("\t moyenne des 10 derniers poids = ");
Serial.println(total/NB_ECHANTILLON, 2);
delay(100);
}