Go to Post 22 motors? Challenge Accepted. - gyroscopeRaptor [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #6   Spotlight this post!  
Unread 01-31-2011, 08:55 AM
demosthenes2k8's Avatar
demosthenes2k8 demosthenes2k8 is offline
Graduated but not gone
AKA: Matt Soucy
FRC #0166 (Chop Shop 166)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Merrimack, NH
Posts: 588
demosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to beholddemosthenes2k8 is a splendid one to behold
Send a message via AIM to demosthenes2k8 Send a message via Yahoo to demosthenes2k8
Re: Need SmartDashboard Help

My team made a function (it's part of our framework) to make an interface for that dsLCD that behaves essentially exactly like printf.

Code:
/**
 * Send text to DS LCD display
 */
int DriverStationDisplay(const char* format, ...)
{
        va_list args;
        static string dash_string[6];
        static bool init=true;
        char formatted_string[DASHBOARD_BUFFER_MAX];
        if(init) {
                //Initializes it first call.
                for(int i=0;i<6;i++) {
                        dash_string[i] = "                     ";
                }
                init=false;
        }
        va_start( args, format );
        vsnprintf(formatted_string, DASHBOARD_BUFFER_MAX, format, args);
        va_end(args);
        
        //Move lines up to make room for the newline 
        for(int i=5; i>=1; i--) {
                dash_string[i] = dash_string[i-1];
        }
        dash_string[0] = formatted_string;

        for(int i=0; i<6; i++) {
                dsHandleLCD->PrintfLine((DriverStationLCD::Line)i, dash_string[i].c_str());
        }
        dsHandleLCD->UpdateLCD();
        return 0;
}
Feel free to use it, or even the whole framework, from http://framework.chopshop166.com/

And you're welcome for the launcher, Ben wrote it really quickly, but it's small and works very well!
__________________


GSR Dean's List Finalist 2011
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 10:20 AM.

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