0
代碼不會爲WeMos D1編譯,但對於Arduino Uno可以正常工作。代碼不會爲WeMos D1編譯,但對Arduino Uno可以正常工作
我得到的錯誤
error: 'A1' was not declared in this scope
#include "HX711.h"
HX711 scale(A1, A0);// parameter "gain" is ommited; the default value 128 is used by the library
void setup() {
Serial.begin(9600);//2280
scale.set_scale(1810.f); //// this value is obtained by calibrating the scale with known weights
scale.tare();
}
void loop() {
Serial.print("\n");
Serial.print(scale.get_units(), 1);
scale.power_down(); // put the ADC in sleep mode
delay(500);
scale.power_up();
}
ESP8266只有一個模擬引腳,不能用作數字引腳。下面的答案 –
將被標記爲分辨率。 – cagdas