Instead of led = 1 or led = 0 use this: TRISIO.2 = 0 or TRISIO.2 = 1
You have to connect your IR led to GPIO.2, not GPIO.5
Toggling TRISIO.2 will modulate your IR led