Go to Post I guess my only option is to either stop picking on Dave or come up with an even better picture! Now, which one do you think I'll choose? - MissInformation [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 07-03-2006, 19:35
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Question OI LED programming

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?
  #2   Spotlight this post!  
Unread 08-03-2006, 08:48
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: OI LED programming

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.
  #3   Spotlight this post!  
Unread 08-03-2006, 20:20
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: OI LED programming

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:
Code:
OI_LED_08 = &switch_01
But I can't seem to figure out how to use pointers in EasyC, even though the camera capture function uses them.
  #4   Spotlight this post!  
Unread 12-03-2006, 09:11
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: OI LED programming

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 ) ;
}
Attached Thumbnails
Click image for larger version

Name:	OILED.jpg
Views:	39
Size:	15.6 KB
ID:	4115  Click image for larger version

Name:	enabled.jpg
Views:	32
Size:	14.8 KB
ID:	4116  
  #5   Spotlight this post!  
Unread 12-03-2006, 18:54
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
Re: OI LED programming

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, 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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming - Getting Started Mark McLeod Programming 80 16-04-2008 23:37
Making a beacon indicator LED burn its brightest without burning out DanL Electrical 7 26-01-2004 08:05
Help On Coding 2K1 Controller GregTheGreat Programming 9 05-12-2003 18:35
Rookie Programmer has question about the default code DanL Programming 3 26-01-2002 19:59


All times are GMT -5. The time now is 23:06.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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