Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By darsh_t
#91046 I tried to retrieve humidity and temperature using the DHT11 sensor with ESP8266. However, I have been getting a compiling error such as "lua:4: unexpected symbol near ',' ". If possible, could anyone also point out the other potential errors in this code? My code looks as follows: :)

Code: Select all 

pin = 1

status, temp, humi, temp_dec, humi_dec = dht.read(pin)--read dht11 from pin

if status == dht.OK then    --check status is ok and print temperature and humidity
print(string.format( "DHT Temperature:%d.%03d;Humidity:%d.%03d" )
elseif status == dht.ERROR_CHECKSUM then    --else print either status
print( "DHT Checksum error." )
elseif status == dht.ERROR_TIMEOUT then
print( "DHT timed out." )