vrijdag 8 juli 2016

ESP8266 Basic IR sensor

ESP8266 Basis can also read Infra Red sensor
The manual of version 3 ESP8266Basic contains a little error IR receiver part.

ir.recv.setup(pin)
set the pin used for the IR reception (IR receiver connected to the pin)
example:
ir.recv.init(5) ‘set the pin 5
Needs to be
ir.recv.setup(pin)
set the pin used for the IR reception (IR receiver connected to the pin)
example:
ir.recv.setup( 5 ) ‘set the pin 5

I used the demo program below to test a  "TL1838 VS1838B 1838 38Khz Universal IR Infrared Receiver"  ( Aliexpress : 100 pcs less than 7 euro / The 37in1 Arduino KY-022 sensor should also work fine.) on pin GPIO14:

'  IR receive demo  ESP Basic 3.0.Alpha 8 
' http://blog.jeronimus.net

ir.recv.setup( 14 )
wprint "<h1> Testing IR input</h1>"
irbranch [DoIR]
wait

[DoIR]
wprint "<BR>IR received : " & ir.recv.full( )
returngui

return

end

Sometimes i did get an additional signal code "ffffffff:NEC:0" but most times i receive usable codes.

Geen opmerkingen: