Go to Post If people are getting offended at seeing other teams list their accomplishments, maybe they should spend less time whining and more time doing things to make their own team win. - artdutra04 [more]
Home
Go Back   Chief Delphi > Technical > Programming
Team 51   CD-Events   CD-Media   CD-Swap   CD-Spy   FRC-Spy   Unsung FIRST Heroes   WFA
portal register members calendar search Today's Posts Mark Forums Read FAQ rules
VEXpro
The Chief Delphi Forums are sponsored by Innovation First International, Inc.
Kettering University
ADVERTISEMENT

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-23-2006, 12:56 PM
Ami Schwartz Ami Schwartz is offline
Registered User
FRC #1657
 
Join Date: Jan 2006
Location: Israel
Posts: 24
Ami Schwartz is an unknown quantity at this point
Exclamation G.T.S ..... (problem)

While one of my team mates was running a try out on G.T.S he thought there is somthing wrong with the way it worked :


He hooked it up and while it worked he didn't receive output from the sensor to the "IFI Loader" ( the only thing he got was the number " 0 " )


**Even when the sensor was not connected it got " 0 " or "256".



So, my question is if some one can please tell me if it's ok that i didn't receive any outpot from the Sensor.



P.S > It was connected my a digital IN/OUT on the RC .




Thx. Hamosad team # 1657
  #2   Spotlight this post!  
Unread 01-23-2006, 01:06 PM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is online now
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 7,051
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Send a message via AIM to Alan Anderson
Re: G.T.S ..... (problem)

I assume you're referring to the Gear Tooth Sensor. It sounds like you're having two conceptual difficulties with printing its value.

First, its output is a very short high-going pulse whenever a gear tooth passes the sensor. It's on the order of 40-80 microseconds long. Unless you get extremely lucky, your code is not very likely to read anything other than a 0.

Second, it sounds like you might be trying to use printf with a char. For a couple of technical reasons, that doesn't work exactly the way you want it to. You'll need to cast the value to an int like this:
Code:
  char value = 1;
  ...
  printf ( "value = %d\r", (int)value );
The proper way to read the gear tooth sensor is to have it create an interrupt whenever it emits a pulse, and to use the interrupt service routine to count the pulses.
  #3   Spotlight this post!  
Unread 01-24-2006, 08:17 AM
Ami Schwartz Ami Schwartz is offline
Registered User
FRC #1657
 
Join Date: Jan 2006
Location: Israel
Posts: 24
Ami Schwartz is an unknown quantity at this point
Re: G.T.S ..... (problem)

Thx, but we think we know the problem.

we think that the sensor got short" .
  #4   Spotlight this post!  
Unread 01-28-2006, 04:01 PM
Raym Raym is offline
Registered User
FRC #1138
 
Join Date: Jan 2006
Location: West Hills, CA
Posts: 9
Raym is on a distinguished road
Re: G.T.S ..... (problem)

Quote:
Originally Posted by Alan Anderson
I assume you're referring to the Gear Tooth Sensor. It sounds like you're having two conceptual difficulties with printing its value.

First, its output is a very short high-going pulse whenever a gear tooth passes the sensor. It's on the order of 40-80 microseconds long. Unless you get extremely lucky, your code is not very likely to read anything other than a 0.

Second, it sounds like you might be trying to use printf with a char. For a couple of technical reasons, that doesn't work exactly the way you want it to. You'll need to cast the value to an int like this:
Code:
  char value = 1;
  ...
  printf ( "value = %d\r", (int)value );
The proper way to read the gear tooth sensor is to have it create an interrupt whenever it emits a pulse, and to use the interrupt service routine to count the pulses.
the GTS code returns a LONG int.

Good Luck.
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
Need a realistic Statics Problem sanddrag Technical Discussion 10 12-05-2005 02:07 PM
Problem w/Mesh Kevin342 3D Animation and Competition 4 02-17-2005 10:04 PM
Programming Problem: Extremely Frustrating chantilly_team Programming 19 02-12-2005 10:00 PM
The problem with scouting... archiver 2001 10 06-23-2002 10:49 PM
Major problem with chipphua motors aka Scott White Motors 18 03-19-2002 06:44 PM


All times are GMT -5. The time now is 02:35 PM.

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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © Delphi and Pontiac Central High School