Go to Post I love it when awards go to the right people. - David Kelso [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-02-2013, 20:42
Gmercer Gmercer is offline
Registered User
None #1631
 
Join Date: Jan 2013
Location: Las Vegas
Posts: 15
Gmercer is an unknown quantity at this point
How do i initialize the GearTooth sensor

I just received a GearTooth sensor today to program into the robot in order to keep track of RPM, but i have no clue how to set up the gearTooth. I read the documentation on the class but couldn't figure out what to do, here is what i currently have:

Declaration:
Code:
GearTooth shootSensor = new GearTooth(3);
in the robot initialize function:
Code:
shootSensor.setupSource(3);
my data function(called every two seconds in the main loop):
Code:
SmartDashboard.putNumber("Test:",shootSensor.getPeriod());
no values though, what could i be doing wrong?
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2013, 21:04
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: How do i initialize the GearTooth sensor

Try replacing the setupSource() method with start(). This will start the GearToothSensor listening on port 3 for the counts.

You don't need to set up the port since you are passing the channel number (3 in your case) to the constructor. The GearToothSensor object will allocate a the port for you.

Brad
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
Reply


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


All times are GMT -5. The time now is 11:42.

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