Exemple #1
0
 public void Illuminate(Led led, int duration)
 {
     Leds[led.Port].Write(true);
     Levels[led.Level].Write(true);
     Thread.Sleep(duration);
     Leds[led.Port].Write(false);
     Levels[led.Level].Write(false);
 }
Exemple #2
0
 private Led CoordinateToLed(byte x, byte y, byte z)
 {
     var led = new Led();
     if (Orientation == CubeOrientations.ZPos)
     {
         // "Normal" orientation, no 3D translation necessary.
         led.Port = (byte)(x + 3 * z);
         led.Level = y;
     }
     else
     {
         // TODO: Translate the coordinate.
     }
     return led;
 }