Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Threading;
- using NetduinoGo;
- namespace NetduinoGo_Test
- {
- public class Program
- {
- private static readonly byte[][] Colours = new byte[8][];
- public static void Main()
- {
- Colours[0] = new byte[] { 255, 0, 0 }; //Red
- Colours[1] = new byte[] { 255, 29, 206}; //Pink
- Colours[2] = new byte[] { 244, 128, 0 }; //Orange
- Colours[3] = new byte[] { 255, 255, 0 }; //Yellow
- Colours[4] = new byte[] { 29, 249, 20 }; //Lime
- Colours[5] = new byte[] { 0, 255, 0 }; //Green
- Colours[6] = new byte[] { 0, 0, 255 }; //Blue
- Colours[7] = new byte[] { 255, 0, 255 }; //Purple
- RgbLed[] leds = new RgbLed[8];
- //leds[0] = new RgbLed();
- for (int i = 0; i < leds.Length; i++)
- leds[i] = new RgbLed();
- int current = 0, pos = 0;
- while (true)
- {
- current = pos;
- for(int i = 0; i<leds.Length; i++)
- {
- if (current > 7)
- current = 0;
- leds[i].SetColor(Colours[current][0], Colours[current][1], Colours[current][2]);
- current++;
- }
- if (pos == 7)
- pos = 0;
- else
- pos++;
- Thread.Sleep(125);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment