// amateur code - use at own risk - author accepts no responsibility for anything, anywhere, ever
// I have used direct-register programming, as it is what I am more familiar with - you may use BASIC style code if you wish
// tested on EasyPIC v7 development board with IR click inserted into mikroBUS 2 socket
Device = 18F43K22
Clock = 8 // adjust to suit your setup
// simple IR receiver test - PORTD LEDs reflect IR input status from RA3
// IR input is on RA3 - from 3-pin 38 KHz IR receiver module such as TSOP38338
// IR output is on RC1 - not used here
// LEDs on PORTD.0 and PORTD.1 where D0 mirrors input, D1 is inverted compared to IR input
ANSELA = 0 // all digital
TRISA = $ff // all input for IR and switches
LATA = 0 // all low
ANSELD = 0 // all digital
TRISD = 0 // all output for LEDs
LATD = 1 // LED pattern 0x01
Repeat
If PORTA.3 = 1 Then // test IR input on RA3
LATD = 1 // LED on D0 lit if IR input is high (normal state) , LED on D1 off
Else
LATD = 2 // LED on D1 lit, LED on D0 off
EndIf
Until false