public static LightSequence CylonSequence( int length, int displayTimeInMilliSeconds, ChipColor backColor, ChipColor foreColor )
        {
            LightSet[] tempLightSets = new LightSet[ length * 2 ];

            for ( int lightSetIndex = 0; lightSetIndex < length; lightSetIndex++ ) {
                ChipColor[] colors = new ChipColor[ length ];
                for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                    if ( colorIndex == lightSetIndex )
                        colors[ colorIndex ] = foreColor;
                    else
                        colors[ colorIndex ] = backColor;
                }
                tempLightSets[ lightSetIndex ] = new LightSet( displayTimeInMilliSeconds, colors );
            }

            for ( int lightSetIndex = length; lightSetIndex < length * 2; lightSetIndex++ ) {
                ChipColor[] colors = new ChipColor[ length ];
                for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                    if ( colorIndex == lightSetIndex - length )
                        colors[ length - 1 - colorIndex ] = foreColor;
                    else
                        colors[ length - 1 - colorIndex ] = backColor;
                }
                tempLightSets[ lightSetIndex ] = new LightSet( displayTimeInMilliSeconds, colors );
            }

            return FromLightSets( tempLightSets );
        }
コード例 #2
0
 public static LightSet FromChipColor( int displayTimeInMilliSeconds, int count, ChipColor color )
 {
     ChipColor[] colors = new ChipColor[ count ];
     for ( int index = 0; index < count; index++ ) {
         colors[ index ] = color.Clone();
     }
     return new LightSet( displayTimeInMilliSeconds, colors );
 }
        public static LightSequence LEDTestSequence( int length, int displayTimeInMilliseconds )
        {
            LightSet[] tempLightSets = new LightSet[ 4 ];

            ChipColor[] colors = new ChipColor[ length ];
            for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                colors[ colorIndex ] = ChipColor.PureBlack;
            }
            tempLightSets[ 0 ] = new LightSet( displayTimeInMilliseconds, colors );

            //			colors = new ChipColor[ length ];
            for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                colors[ colorIndex ] = ChipColor.PureRed;
            }
            tempLightSets[ 1 ] = new LightSet( displayTimeInMilliseconds, colors );

            //			colors = new ChipColor[ length ];
            for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                colors[ colorIndex ] = ChipColor.PureGreen;
            }
            tempLightSets[ 2 ] = new LightSet( displayTimeInMilliseconds, colors );

            //			colors = new ChipColor[ length ];
            for ( int colorIndex = 0; colorIndex < length; colorIndex++ ) {
                colors[ colorIndex ] = ChipColor.PureBlue;
            }
            tempLightSets[ 3 ] = new LightSet( displayTimeInMilliseconds, colors );

            return FromLightSets( tempLightSets );
        }
コード例 #4
0
 public LightSet( int displayTimeInMilliseconds, ChipColor[] colors )
 {
     this.Colors = colors.Clone() as ChipColor[];
     this.DisplayTimeInMilliSeconds = displayTimeInMilliseconds;
 }
コード例 #5
0
 public LightSet( ChipColor[] colors )
 {
     this.Colors = colors;
     this.DisplayTimeInMilliSeconds = 100;
 }