【发布时间】:2017-04-11 13:31:22
【问题描述】:
代码无法为 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 只有一个模拟引脚,不能用作数字引脚。
-
下面的答案将被标记为分辨率。
标签: arduino esp8266 arduino-esp8266