Current Lua downloadable firmware will be posted here

User avatar
By Erni
#3076
Personally, I would like to work WITHOUT an At85


Me too, but if I understand it correct we don't have access to the adc on a esp8266-01 ?
I was thinking of DHT11, TM35 ,voltage sensing and so on.
Besides the size of the t85 another benefit isd that it can run on the same 3.3V supply as the esp8266.
And then there is the advantages that there allready are arduino lib's for for example DHT11/22
User avatar
By gerardwr
#3080
Erni wrote:
Personally, I would like to work WITHOUT an At85


Me too, but if I understand it correct we don't have access to the adc on a esp8266-01 ?
I was thinking of DHT11, TM35 ,voltage sensing and so on.
Besides the size of the t85 another benefit isd that it can run on the same 3.3V supply as the esp8266


The chip on the ESP8266-01 has 1 analog channel, the TOUT pin. If you manage to solder a wire to this pin I assume (haven't tried it yet) that you can use the analog channel. I think that the ADC.READ(0) command in the API reads from this pin, but this has not been confirmed yet by zero day.

Some (theoretical) thoughts about the sensors you mention:
DHT11: Has been tried and mentioned on this topic, but did not seem to work. In principle the ESP perfectly capable to provide the simple DHT procol, IF the Lua implementation for toggling GPIO bits and reading of GPIO bits is fast enough.
TM35: An analog temperature sensor, connect to TOUT
Voltage sensing: TOUT

I2C is supported in the firmware, so any I2C sensor would do. I read that there are 4 channel ADC to I2C chips. But then again, a At85 can do this.

Interesting times!

@zeroday. Can you confirm that ADC.READ(0) checks the TOUT pin?
User avatar
By picstart1
#3082 Update Nov 21 2014 the issue is the call tmr.alarm(1000,1,blink()) needs to be just tmr.alarm(1000,1,blink) to get it to work

The code below only calls blink one time
Code: Select allled = 8
i=1
ledstate=0

gpio.mode(led,gpio.OUTPUT)

tmr.alarm(1000,1,blink())


function blink()
print(i)
if ledstate==0 then
  gpio.write(led,gpio.HIGH)
  ledstate=1
 else
 gpio.write(led,gpio.LOW)
 ledstate=0
 end
i=i+1
if i==10 then
 print("stop")
 tmr.stop()
end
print("blinked")
end

the code below works
Code: Select allled = 8
i=1
ledstate=0

gpio.mode(led,gpio.OUTPUT)

tmr.alarm(1000,1,
function ()
print(i)
if ledstate==0 then
  gpio.write(led,gpio.HIGH)
  ledstate=1
 else
 gpio.write(led,gpio.LOW)
 ledstate=0
 end
i=i+1
if i==10 then
 print("stop")
 tmr.stop()
end
print("blinked")
end

)


The only difference is the function isn't named and is inline with tmr.alarm
Is this my error or a bug?
Last edited by picstart1 on Fri Nov 21, 2014 2:00 pm, edited 1 time in total.
User avatar
By zeroday
#3085
gerardwr wrote:
Erni wrote:
Personally, I would like to work WITHOUT an At85


Me too, but if I understand it correct we don't have access to the adc on a esp8266-01 ?
I was thinking of DHT11, TM35 ,voltage sensing and so on.
Besides the size of the t85 another benefit isd that it can run on the same 3.3V supply as the esp8266


The chip on the ESP8266-01 has 1 analog channel, the TOUT pin. If you manage to solder a wire to this pin I assume (haven't tried it yet) that you can use the analog channel. I think that the ADC.READ(0) command in the API reads from this pin, but this has not been confirmed yet by zero day.

Some (theoretical) thoughts about the sensors you mention:
DHT11: Has been tried and mentioned on this topic, but did not seem to work. In principle the ESP perfectly capable to provide the simple DHT procol, IF the Lua implementation for toggling GPIO bits and reading of GPIO bits is fast enough.
TM35: An analog temperature sensor, connect to TOUT
Voltage sensing: TOUT

I2C is supported in the firmware, so any I2C sensor would do. I read that there are 4 channel ADC to I2C chips. But then again, a At85 can do this.

Interesting times!

@zeroday. Can you confirm that ADC.READ(0) checks the TOUT pin?


Yes TOUT.