|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Getting Encoder Values in the Dashboard
I am trying to get Encoder Values back into the Dashboard and have no idea where to start. We are working on trying to get PWM values back into Dashboard right now, but I cannot find ANY info this procedure for Encoders.
Please help if you have successfully done this. |
|
#2
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
I've sent arbitrary data to the dashboard. Only the type matters, not the source. Encoders will return either an INT32 or a double depending on if you call Get() or GetDistance(). You can send either one by using the correct data type when you pack the dashboard data.
|
|
#3
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Quote:
For Example double dblEncoder1Value; dblEncoder1Value = encoder1.Get(); then would I do something like: PackAndSend(dblEncoder1Value); Forgive me if the questions I have asked sound obvious, I just really can't figure this out. |
|
#4
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Quote:
|
|
#5
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Quote:
EDIT: we have the variable that holds the encoder value declared as an INT32 because that is what the .Get() function returns. We are using the DriverStationLCD class to print the value back to the dashboard (actually the user messages section of the driver station) Also, we tried setting our loop to only run while the encoder value was less than a specific amount (in this case 500) and it just kept running. Has anyone else had this problem and how did you get it fixed? I noticed something a little strange: When our wheels are turning, the 3rd, 4th, 5th, and 6th light under Digital I/O on the dashboard flash. The first 2 are greyed out. I thought this was strange because our encoders are plugged into ports 11, 12, 13, and 14. I am starting to wonder if this is what is causing the issue because of the way I have the encoders declared/initialized Last edited by Kyledoo : 02-07-2010 at 09:43 PM. |
|
#6
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Has anyone else gotten encoder or other numerical values in this field? How did you format the data?
|
|
#7
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Quote:
Code:
myDS_LCD->Printf(DriverStationLCD::kUser_Line1, 1, "%d", encoderValue); myDS_LCD->UpdateLCD(); |
|
#8
|
|||
|
|||
|
Re: Getting Encoder Values in the Dashboard
Thank you, we ended up figuring it out. FINALLY THE TROUBLE WITH ENCODERS IS OVER!!
|
|
#9
|
||||
|
||||
|
Re: Getting Encoder Values in the Dashboard
Quote:
I'd recommend using PrintfLine instead (available in newest version of WPILib), which pads the line with blank spaces. If you just use printf, then if your number grows and then shrinks it will leave parts of the old number there. Of course, one could play with formatting options to fix that... |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't see any values on dashboard | kevinb999 | C/C++ | 11 | 02-03-2010 02:41 PM |
| Optical encoder not returning values | MBernstein | Motors | 11 | 02-09-2009 10:10 PM |
| help getting servo values from camera | ruddy | Programming | 12 | 11-30-2007 11:18 PM |
| Dashboard View of Pan and Tilt Servo Values | JoeXIII'007 | Programming | 1 | 02-02-2005 10:34 PM |