Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   How do i initialize the GearTooth sensor (http://www.chiefdelphi.com/forums/showthread.php?t=113999)

Gmercer 19-02-2013 20:42

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?

BradAMiller 19-02-2013 21:04

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


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

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