Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   controlling the leds (http://www.chiefdelphi.com/forums/showthread.php?t=52208)

hanan 18-01-2007 18:50

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

Jimmy Cao 18-01-2007 21:50

Re: controlling the leds
 
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
Code:

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.

Gamer930 18-01-2007 22:05

Re: controlling the leds
 
SetOILED ( 5 , 1 ) ;
This sets Relay 1 Red to on
There is "OI LED" under RC Control menu.


All times are GMT -5. The time now is 03:58.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi