View Single Post
  #19   Spotlight this post!  
Unread 27-01-2011, 18:00
charrisTTI charrisTTI is offline
Ramblin' Wreck
AKA: Charles Harris
FRC #0623
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Vienna, VA
Posts: 106
charrisTTI has a spectacular aura aboutcharrisTTI has a spectacular aura about
Send a message via AIM to charrisTTI
Re: Driverstation / Dashboard in JAVA

With version 2011.4 I observed that the posted dashboard code does not properly map the digital i/o pins on the sidecar to the leds on the dashboard gpio state and gpio output enable. First two leds are always off and led 3 maps to digital i/o 14. i/o 1 and 2 do not change any led on the dashboard.

The following code works properly:

Code:
                        
                        int dioData = 0;
                        for( int i = 1; i <= 14; i++)
                        {
                            if( DigitalModule.getInstance( module ).getDIO( i ) )
                            {
                                dioData |= ( 1 << i-1 );
                            }
                        }
                        lowDashData.addShort((short)dioData);
                        int dioDir = 0;
                        for( int i = 1; i <= 14; i++)
                        {
                            if( DigitalModule.getInstance( module ).getDIODirection( i ) )
                            {
                                dioDir |= ( 1 << i-1 );
                            }
                        }
                        lowDashData.addShort((short)dioDir);
There seems to be a problem with getAllDIO() and getDIODirection().
__________________
FRC 623 2003,2004,2005,2006,2007,2008, 2009, 2010, 2011
FRC 1900 2007
FVC 60 and 193 2006
FVC 3271 2007
FTC 226 and 369 2008, 2009, 2010, 2011
FTC 3806 2010
Reply With Quote