View Full Version : OI LED programming
P1h3r1e3d13
07-03-2006, 19:35
After using the OI LED block to hijack an LED for my own nefarious schemes (or subroutines), is there any way to return it to its rightful purpose (displaying PWM, relay, or switch status) or is it stuck how I set it until the RC resets?
Or does the mysterious EasyC default code map it every time the code loops, so I don't have to worry about it?
Kingofl337
08-03-2006, 08:48
EasyC doesn't use default code your OI LEDs only function when
you program them to. So, they don't monitor the state of relays, or limits
like the default code would.
Also, something to note if you use the small LCD display the LED's don't function and vise versa.
P1h3r1e3d13
08-03-2006, 20:20
Oh really? I hadn't noticed that EasyC didn't run the LEDs - thanks.
Know any way to get it to? It would seem they would have to be mapped to pointers to the switches, PWMs, and relays, something like:OI_LED_08 = &switch_01But I can't seem to figure out how to use pointers in EasyC, even though the camera capture function uses them.
Kingofl337
12-03-2006, 09:11
You can type a variable name in any input or output. You don't have
to set numbers.
void Autonomous ( void )
{
unsigned char LED_0_State;
unsigned char Enabled;
Enabled = IsEnabled ( ) ;
LED_0_State = Enabled ;
SetOILED ( 0 , LED_0_State ) ;
}
P1h3r1e3d13
12-03-2006, 18:54
Thanks, but that part I knew. What I don't is how to grab output values (from PWMs, relays, etc.) to variables. That's what I thought would require pointers.
I think this thread has devolved into the same thing you're helping me with over here (http://www.chiefdelphi.com/forums/showthread.php?t=45182), Kingof1337. Weird.
Anyway the difference between the two questions was based on my misunderstanding of EasyC LED code, so I guess this thread is kinda moot now.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.