![]() |
How to add custom widget to smart dashboard?
Hi!
I'm working on a widget that'll change the background of SmartDashboard to green when we ought to shoot and make it red when we shouldn't shoot. The should/shouldn't shoot shoot is handled in our code, but I don't know what to do about the widget. I downloaded the code found in this thread this thread. And I've uncommented the code to set the color correctly. Thing is, now I don't know how to get that widget onto smartdashboard and activate it when I need to. Help? If anyone has a better way of accomplishing what I've described with the background color, please feel free to chime in. Thanks. |
Our team would also be interested in adding widgets to the SD (a working gyro in our case)
As per your question: does it have to be the background of the whole SD? you can use SmartDashboard.putBoolean to put the "canShoot" boolean on, and change the indicator to a booleanbox (false becomes red, true is green) and then resize the box as you see fit. you could resize it to the whole screen and just send the widget back (provided you are fine with those colors as your background). |
Re: How to add custom widget to smart dashboard?
I agree that the best way is to use a boolean box. It has options to change the colors that are displayed for true and false, if you don't like the defaults.
|
| All times are GMT -5. The time now is 07:23 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi