Go to Post This is a once in a life time event for many of you guys. ENJOY it! - Tom Line [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 22-01-2015, 21:38
N00bfirst N00bfirst is offline
Registered User
FRC #4992
 
Join Date: Dec 2013
Location: Milton
Posts: 8
N00bfirst is an unknown quantity at this point
Dashboard not displaying messages

Our dashboard does not seem to display any message whatsoever when we try to run the robot code.

Can anybody please explain why such a thing is happening and how we can write to the dashboard?

This is just sample code to get the hang of the encoder average encoder value. Apologies for the terrible variable names.

However, it does not display a message even if I do something simple like trying to print a value onto the dashboard.

public void autonomousInit() {
autoLoopCounter = 0;
Encoder sampleEncoder = new Encoder(8, 9, false, Encoder.EncodingType.k2X);
sampleEncoder.setMaxPeriod(0.1);
sampleEncoder.setMinRate(10);
sampleEncoder.setDistancePerPulse(5);
sampleEncoder.setSamplesToAverage(7);
sampleEncoder.reset();

SmartDashboard.putNumber("hmm", 2);

double k = sampleEncoder.getRate();
boolean what = sampleEncoder.getStopped();
String huh = sampleEncoder.getSmartDashboardType();
while (k>10){
String k2 = Double.toString(k);
double distance = sampleEncoder.getDistance();
String distance1 = Double.toString(distance);
SmartDashboard.putNumber(k2, k);
SmartDashboard.putNumber(distance1, distance);
SmartDashboard.putBoolean(huh, what);
}
Reply With Quote
 


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:39.

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