'SV200B/C - SV200C IR Transmitter Functions
'The SV200C as an IR transmit feature as allow the board to send Sony style
'single over an infrared emitting diode connected to pin 5 and 6 of port C
'(see pin-out on page 21).

'This program reconfigure port B as digital input. When a button is pressed,
'a IR signal corresponding to each button will be sent out the IR LED to
'control a SONY TV or another SV200C board remotely.

DIM bPWR   as BIT 0 of RB
DIM bChUp  as BIT 1 of RB
DIM bChDn  as BIT 2 of RB
DIM bVolUp as BIT 3 of RB
DIM bVolDn as BIT 4 of RB
DIM OPTION at 129
DIM bRBPU  as BIT 7 of OPTION

Servo1 = 0 : Servo2 = 0 : Servo3 = 0 : Servo4 = 0      'Turn of PWM
Servo5 = 0 : Servo6 = 0 : Servo7 = 0 : Servo8 = 0
bRBPU = 0           'Enable weak Port B pull-up
TRISB = 11111111b   'Configure Port B as all inputs
DO			
   if not bPWR   then IRreg = ASC("F") : Call IRsend
   if not bChUp  then IRreg = ASC("A") : Call IRsend
   if not bChDn  then IRreg = ASC("B") : Call IRsend
   if not bVolUp then IRreg = ASC("C") : Call IRsend
   if not bVolDn then IRreg = ASC("D") : Call Irsend
   Delay 5         'Small delay for debounce
LOOP												'Loop back to DO



