-->
Page 1 of 1

IRDA serial communication

PostPosted: Wed Oct 16, 2019 7:05 am
by juanmol
hi, i'm trying to transmit some data with IRDA, i'm trying with this code at emitter:
Code: Select allcount = 0

-- set uart0 with 1200 baud rate, 8 databits, no pariy, 1 stop bit with echo
uart.setup(0,1200,8,0,1,1)

while true do   -- continuous send count
    print(count)
    count = count + 1
tmr.delay(1000000)
end


and this one at the receiver:
Code: Select all-- set uart0 with 1200 baud rate, 8 databits, no pariy, 1 stop bit with echo
uart.setup(0,1200,8,0,1,1)
--print received data
uart.on("data", "\n", function(data) print("receive from uart:", data) end, 0)


But in both cases, when try to config the uart i lost connection in esplorer. I'm using nodemcu v3, is there any way to configure other serial port for this?

Re: IRDA serial communication

PostPosted: Wed Oct 16, 2019 7:37 am
by marcelstoer
https://nodemcu.readthedocs.io/en/latest/modules/uart/

Although there are two UARTs(0 and 1) available to NodeMCU, UART 1 is not capable of receiving data and is therefore transmit only.


As for tmr.delay(1000000) please see this: https://nodemcu.readthedocs.io/en/lates ... /#tmrdelay