As the title says... Chat on...

User avatar
By 1314258
#61568 @raz123

is it possible to write a ir sender by lua?
i wrote one,but i think that the lua cannot fast enough to send a 38khz light.
may be the code is too dirty.

Code: Select all   local function mark(mtime)
      local begin=tmr.now()
      while(tmr.now()-begin<mtime)
         do
            write(irpin,1)
            waitus(halfPeriodicTime)
            write(irpin,0)
            waitus(halfPeriodicTime)
         end
   end
User avatar
By marcelstoer
#61582
devsaurus wrote:I guess that there are too many inaccuracies when doing this from Lua.


We've had and example in our repo at https://github.com/nodemcu/nodemcu-firm ... irsend.lua for quite some time but I have no idea whether that still works.