rIRremote (Arduino) is based on IRremote open source project: https://github.com/z3t0/Arduino-IRremote
rIRremoteESP8266 (ESP8266) is based on IRremoteESP8266 open source project: https://github.com/markszabo/IRremoteESP8266
These libraries allow receiving IR signals with a IR receiver module and transmitting signals with an IR led.
The two libraries are mostly identical.
Receiving signals:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
Sending signals:
	
	
	
	
	
	
	
		
			
			
			
			
			
		
	
	
	
		
	
	
		
	
On ESP8266 the Enable method includes another parameter for the pin number.
On Arduino the pin is set in the library:
Arduino Mega 9 and 3 on other Arduino models.
The transmitting led should be connected with a 100 ohm resistor.
I'm not sure why, but in my tests the transmitting led range was very short (a few centimeters).
			
			rIRremoteESP8266 (ESP8266) is based on IRremoteESP8266 open source project: https://github.com/markszabo/IRremoteESP8266
These libraries allow receiving IR signals with a IR receiver module and transmitting signals with an IR led.
The two libraries are mostly identical.
Receiving signals:
			
				B4X:
			
		
		
		Sub Process_Globals
   Public Serial1 As Serial
   Private ir As IrReceive
End Sub
Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   ir.Initialize(6, "ir_Decoded") 'receiver is connected to pin 6, GND and 5v (or 3.3v on ESP8266)
   ir.Enable
End Sub
Private Sub ir_Decoded (Result As IrResult)
   Log("result: ", Result.DecodeType, ", ", Result.Value)
End SubSending signals:
			
				B4X:
			
		
		
		Sub Process_Globals
   Public Serial1 As Serial
   Private irsend As IrSend
   Private timer1 As Timer
End Sub
Private Sub AppStart
   Serial1.Initialize(115200)
   Log("AppStart")
   irsend.Enable(38) 'frequency = 38khz
   timer1.Initialize("timer1_Tick", 500)
   timer1.Enabled = True
End Sub
Sub Timer1_Tick
   Dim m As UInt = Bit.And(Millis, 0xfff) 'get 12 bits
   Log("sending: ", m)
   irsend.SendRC5(m, 12)
End SubOn ESP8266 the Enable method includes another parameter for the pin number.
On Arduino the pin is set in the library:
Arduino Mega 9 and 3 on other Arduino models.
The transmitting led should be connected with a 100 ohm resistor.
I'm not sure why, but in my tests the transmitting led range was very short (a few centimeters).
Attachments
			
				Last edited: 
			
		
	
							 
				 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		 
 
		