Exemple #1
0
                public static APA102LEDStrip Init(Nusbio nusbio, LedPerMeter ledPerMeter, StripIndex stripIndex, int ledOnStrip)
                {
                    switch (stripIndex)
                    {
                    case StripIndex._0:
                        switch (ledPerMeter)
                        {
                        case LedPerMeter._1Led:         // Extension 2 RGB LED Panel
                            return(new APA102LEDStrip(nusbio, 1, 4, 5).AllOff());

                        case LedPerMeter._2LedTest:
                            return(new APA102LEDStrip(nusbio, ledOnStrip, 3, 2).AllOff());

                        case LedPerMeter._30LedPerMeter:
                            return(new APA102LEDStrip(nusbio, ledOnStrip, 2, 3).AllOff());

                        case LedPerMeter._60LedPerMeter:
                            return(new APA102LEDStrip(nusbio, ledOnStrip, 3, 2).AllOff());
                        }
                        break;

                    case StripIndex._1:
                        switch (ledPerMeter)
                        {
                        case LedPerMeter._1Led:         // Extension 2 RGB LED Panel
                            return(new APA102LEDStrip(nusbio, 1, 6, 7).AllOff());

                        case LedPerMeter._30LedPerMeter:
                            return(new APA102LEDStrip(nusbio, ledOnStrip, 4, 5).AllOff());

                        case LedPerMeter._60LedPerMeter:
                            return(new APA102LEDStrip(nusbio, ledOnStrip, 5, 4).AllOff());
                        }
                        break;
                    }
                    throw new ArgumentException("Cannot create instance of APA102LEDStrip");
                }
 public static APA102LEDStrip Init(Nusbio nusbio, LedPerMeter ledPerMeter, StripIndex stripIndex, int ledOnStrip)
 {
     switch (stripIndex)
     {
         case StripIndex._0:
             switch (ledPerMeter)
             {
                 case LedPerMeter._1Led: // Extension 2 RGB LED Panel 
                     return new APA102LEDStrip(nusbio, 1, 4, 5).AllOff();
                 case LedPerMeter._30LedPerMeter:
                     return new APA102LEDStrip(nusbio, ledOnStrip, 2, 3).AllOff();
                 case LedPerMeter._60LedPerMeter:
                     return new APA102LEDStrip(nusbio, ledOnStrip, 3, 2).AllOff();
             }
         break;
         case StripIndex._1:
             switch (ledPerMeter)
             {
                 case LedPerMeter._1Led: // Extension 2 RGB LED Panel 
                     return new APA102LEDStrip(nusbio, 1, 6, 7).AllOff();
                 case LedPerMeter._30LedPerMeter:
                     return new APA102LEDStrip(nusbio, ledOnStrip, 4, 5).AllOff();
                 case LedPerMeter._60LedPerMeter:
                     return new APA102LEDStrip(nusbio, ledOnStrip, 5, 4).AllOff();
             }
         break;
     }
     throw new ArgumentException("Cannot create instance of APA102LEDStrip");
 }