Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   E4P Encoders not workind (http://www.chiefdelphi.com/forums/showthread.php?t=132790)

HTTMonado 13-01-2015 17:30

E4P Encoders not workind
 
Our encoders don't return any value when I used the Encoder class (C++ WPIlib.) Here's what I have to configure and read the encoder.

I ended up straight up copying the example code from the WPIlib documentation

We have confirmed that the encoders are on the correct digital input on the robot rio.

Code:


Encoder *leftEncode;       
leftEncode = new Encoder(6, 7, false, Encoder::k4X);

leftEncode->SetMaxPeriod(.1);
leftEncode->SetMinRate(10);
leftEncode->SetDistancePerPulse(5);
leftEncode->SetReverseDirection(true);
leftEncode->SetSamplesToAverage(7);

SmartDashboard::PutNumber("Encoder One value", leftEncode->GetRate());



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

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