IR simulation.

RNovember

Well-known member
#1
Hello,
For one of my projects, https://picaxeforum.co.uk/threads/combination-lock.31329/, it would be nice to be able to simulate my remote. But the simulation remote doesn't have all the buttons that a regular remote does. This means that the code I use to simulate can't be the code I actually run. This means that to simulate, I have to change what button the program is looking for, and substitute it for another. Then when I want to download the program, I have to change it back.

Is there an easier way to simulate IR than what I am doing?
Thank you.
 

hippy

Technical Support
Staff member
#2
Is there an easier way to simulate IR than what I am doing?
Two things I can think of are to use a SERIN command instead of IRIN so you can type the IR code at your simulatinon, or add some code which translates the button codes to the codes you want.

One thing you can do is use #IFDEF SIMULATING so you can have two versions of the code which doesn't require editing, will generate the appropriate code for simulation and downloading, for example -
Code:
#IfDef SIMULATING
  SerIn C.3, N4800, b0
#Else
  IrIn C.3, b0
#EndIf
Code:
IrIn C.3, b0
#IfDef SIMULATING
  Select Case b0
    Case 10 : b0 = 27
  End Select
#EndIf
 
Top