【发布时间】:2020-05-12 09:32:57
【问题描述】:
我正在尝试使用我的 ESP8266 测试接近传感器,但是我使用的测试代码一直失败。
每当我运行代码时,都会出现错误:motion sensor.lua:1: '=' expected near 'int'
我还应该提到我正在使用 ESPlorer v0.2.0
const int PIRSensorOutPin = 2; //PIR Sensor OUT Pin
void setup() {
Serial.begin(9600);
pinMode(PIRSensorOutPin, INPUT);
}
void loop()
{
if (digitalRead(PIRSensorOutPin) == LOW)
{
Serial.println("Person detected!"); //Print to serial monitor
}
else {;}
}
我做错了什么?
【问题讨论】:
-
您包含的代码是 C++ Arduino 代码,而不是 LUA。
-
如果您提供遇到错误的代码会很有帮助。
-
else {;}只会让我无所适从。
标签: lua syntax-error esp8266 esplorer