Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
代码赢得';不能为WeMos D1编译,但对Arduino Uno运行良好_Arduino_Esp8266_Arduino Esp8266 - Fatal编程技术网

代码赢得';不能为WeMos D1编译,但对Arduino Uno运行良好

代码赢得';不能为WeMos D1编译,但对Arduino Uno运行良好,arduino,esp8266,arduino-esp8266,Arduino,Esp8266,Arduino Esp8266,代码不会为WeMos D1编译,但可以为Arduino Uno编译 我得到了错误 error: 'A1' was not declared in this scope #包括“HX711.h” HX711刻度(A1,A0);//输入参数“增益”;库使用默认值128 无效设置(){ Serial.begin(9600);//2280 scale.set_scale(1810.f);///该值通过使用已知权重校准标尺获得 皮重(); } void循环(){ 串行打印(“\n”); 串行打印(缩放获

代码不会为WeMos D1编译,但可以为Arduino Uno编译

我得到了错误

error: 'A1' was not declared in this scope
#包括“HX711.h”
HX711刻度(A1,A0);//输入参数“增益”;库使用默认值128
无效设置(){
Serial.begin(9600);//2280
scale.set_scale(1810.f);///该值通过使用已知权重校准标尺获得
皮重();
}
void循环(){
串行打印(“\n”);
串行打印(缩放获取单位(),1);
scale.power_down();//将ADC置于睡眠模式
延迟(500);
缩放。上电();
}
来自:

ESP8266只有一个ADC通道可供用户使用。它可以被使用 读取ADC引脚上的电压,或读取模块电源电压 (VCC)

要读取施加到ADC引脚的外部电压,请使用analogRead(A0)。输入 电压范围为0-1.0V


所以A1也没有定义

ESP8266只有一个模拟管脚,不能用作数字管脚。下面的答案将标记为分辨率。