Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Encoder not working (http://www.chiefdelphi.com/forums/showthread.php?t=103141)

Lawlhwut 18-02-2012 01:15

Encoder not working
 
The E4P encoder is not working on our robot right now. We plugged it into the digital side card digital I/O, 3 wire connection in 3, 1 wire (middle only) connection to 4. And in the code we declared it encoder(3,4), encoder.Start(); encoder.SetDistancePerPulse(####); and DriverStationLCD *screen = DriverStationLCD::GetInstance(); screen->PrintfLine(DriverStationLCD::kUser_Line1,"RPM: %f",encoder.GetRate());

Why isn't it working?

Lawlhwut 18-02-2012 01:17

Re: Encoder not working
 
Channel A = channel 1 signal, Channel B = channel 2 power, Grnd is -, power is power. I'm certain that the wiring is correct.

mikets 18-02-2012 02:55

Re: Encoder not working
 
Quote:

Originally Posted by Lawlhwut (Post 1129322)
Channel A = channel 1 signal, Channel B = channel 2 power, Grnd is -, power is power. I'm certain that the wiring is correct.

I hope you meant Channel B = channel 2 signal.

Alan Anderson 19-02-2012 09:01

Re: Encoder not working
 
Quote:

Originally Posted by Lawlhwut (Post 1129320)
...3 wire connection in 3, 1 wire (middle only) connection to 4...
Why isn't it working?

It isn't working because you have the B channel connected to a 5 volt power pin, not to digital input signal pin. Move it from the middle pin to the pin farthest from the edge of the Digital Sidecar.


All times are GMT -5. The time now is 17:36.

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