View Full Version : OI LED programming
03-07-2006, 07:35 PM
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?
03-08-2006, 08:48 AM
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.
03-08-2006, 08:20 PM
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.
03-12-2006, 09:11 AM
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 ) ;
03-12-2006, 06:54 PM
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-2013, Jelsoft Enterprises Ltd.