-->
Page 39 of 53

Re: NodeMcu - A lua based firmware for esp8266 (build 20141

PostPosted: Thu Nov 20, 2014 7:59 am
by cendev
oops, sorry for the misinformation scargill, i've missed the part calling it again :/ for lua functions are like values , you can recall and voila! the variable changes :)

Re: NodeMcu - A lua based firmware for esp8266 (build 20141

PostPosted: Thu Nov 20, 2014 8:51 am
by alonewolfx2
Hans174 wrote:Hello,

@ zeroday

Thank you very much for your LUA implementation. I flashed your latest file and it works fine.

@ scargill

Maybe you can switch to an I2C temperature sensor. The LM75 should do the job.

Hans

Have you tried lm75 with esp8266?

Re: NodeMcu - A lua based firmware for esp8266 (build 20141

PostPosted: Thu Nov 20, 2014 10:47 am
by picstart1
Code: Select allfile.open("blinkled.lua","w")
  file.writeline([[led = 8]])
    file.writeline([[gpio.mode(led,gpio.OUTPUT)]])
    file.writeline([[for i=0,5,1]])
    file.writeline([[do]])
     file.writeline([[gpio.write(led,gpio.HIGH)]])
     file.writeline([[tmr.delay(1000000)]])
     file.writeline([[gpio.write(led,gpio.LOW)]])
     file.writeline([[tmr.delay(1000000)]])
   file.writeline([[end]])
file.close()
dofile("blinkled.lua")

The led blinks every second so the improved tmr.delay is very likely now resetting the watchdog.
My guess is the watchdog is integral to many expessif routines and is set maybe as a fuse at compile time so one way to prevent it from
counting out is to reset the watchdog counter..What is confusing is there are AT commands that claim to disable and enable the watchdog...The AT is just plain messy.
Anyway having the watchdog always running is very often what you want and resetting it within tmr.delay is a good solution especially since a tmr.delay is blocking
What with various dialects and often more varied responses it is nice to see the AT mess in the rear view mirror thanks to NodeMcu and lua scripts.

Re: NodeMcu - A LUA based firmware for ESP8266 (build 20141

PostPosted: Thu Nov 20, 2014 11:19 am
by zeroday
I move the repo to
https://github.com/nodemcu/nodemcu-firmware

and remove api doc from the repo, because I found out that I can push directly to nodemcu-firmware.wiki. :oops:
I update wiki manually by copy&paste before... :oops: :oops: :oops: