controlling the leds

Hi,
I am using easyC.
Can I control the leds in the OI, that when I am writing setPWM(pwm_relay,value), the led in OI corresponding that relay switch will trun on? (just like the ability to control each pin in plab)
Thanks

Yes. I do not use Easy-C but i can’t believe it’ll be too different from normal coding, cept it has nice buttons

The code would put a 0 or a 1 into the value of the LED you want to set (1 = on 0 = off)

Suposing you want to control Pwm1_green, just do this


if (something_is_true)
  Pwm1_green=1;
else
  Pwm1_green=0;

or whatever you variation of that you want to do. It can also be used to set the Relay LEDs.

SetOILED ( 5 , 1 ) ;
This sets Relay 1 Red to on
There is “OI LED” under RC Control menu.