Go to Post I guess true innovation is when you can actually harness physics to do what you want. Heck -- that sounds suspiciously like engineering. - JVN [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 08-02-2007, 19:17
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Reading Pan Angle from terminal.c

I am confused as to how to properly read Pan Angle in the terminal.c file inside of auto user_routines.c. Do I define
the Pan_Angle parameter inside of terminal.c or
inside of user_routines.c Do I use an extern static unsigned int statement inside of terminal.c and still
use another statement in user_routines.c? I tried to look
through the code and did not find examples.

1) I have added a statement right below where Kevin is outputting Pan Angle in the print statement to calculate
Pan_Angle.

printf(" Pan Angle (degrees) = %d\r\n", (((int)N_SERVO - 124) * 65)/124);
(Pan_Angle= (((int)PAN_SERVO - 124) * 65)/124);

2) Inside of terminal.c I have added
static unsigned int Pan_Angle = 0;

3) What about inside user_routines.c where I actually
want to be able to read the Pan Angle?

A little confused with C-coding standards,
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
  #2   Spotlight this post!  
Unread 08-02-2007, 20:48
DanDon's Avatar
DanDon DanDon is offline
ohhh MY god
AKA: Dan Hoizner
FRC #0375 (The Robotic Plague)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Staten Island, NY
Posts: 1,432
DanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond reputeDanDon has a reputation beyond repute
Send a message via ICQ to DanDon Send a message via AIM to DanDon Send a message via MSN to DanDon
Re: Reading Pan Angle from terminal.c

If you are declaring the variable outside of a function in terminal.c, make it an unsigned char.

In order to be able to access the variable in user_routines.c, put a
Quote:
extern unsigned char Pan_Angle;
at the top of the file, outside the functions.
__________________
  #3   Spotlight this post!  
Unread 09-02-2007, 09:11
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Wink Re: Reading Pan Angle from terminal.c - Error Message

So, I have done the following and received the following error message.

Inside of terminal.c I have placed
1) unsigned char Pan_Angle

Inside of user_routines.c I have placed

2) extern unsigned char Pan_Angle

and I received the following error message.

user_routines.c:566:Fatal [151] -internal p opulateExternalReferences() - symbol 'Pan_Angle' is not an external reference.
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377
  #4   Spotlight this post!  
Unread 09-02-2007, 14:58
mgurgol mgurgol is offline
Registered User
FRC #1094
 
Join Date: Jan 2006
Location: St Louis MO
Posts: 76
mgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nicemgurgol is just really nice
Re: Reading Pan Angle from terminal.c

Do you have the definition of Pan_Angle defined within a function? Defining it outside of any function in terminal.c will make it global. Define it after the #include statements.
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
Camera Pan Angle Problem JohnC Programming 3 29-01-2007 12:25
Help needed with finding stud terminal block from KOP amirjpl Electrical 11 25-01-2006 19:32
Reading binary data from a file and writing it in VB complete Programming 1 02-01-2006 21:21
reading negative numbers from a file in VB complete Programming 4 27-12-2005 19:24
Angle from X,Y Astronouth7303 Programming 18 19-04-2004 22:08


All times are GMT -5. The time now is 16:12.

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