Ejemplo n.º 1
0
 public RaspPi(Lights lights, GpioController controller)
 {
     Lights          = lights;
     Controller      = controller;
     PinsUsedRows    = new int[] { 5, 6, 13, 19, 26 };
     PinsUsedColumns = new int[] { 7, 12, 16, 20, 21 };
     TimeInterval    = 5000;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// When message is recieved from the server, it converts the message and
        /// invokes the DisplayLights Method.
        /// </summary>
        /// <param name="message"></param>
        private void OnReceiveMessage(string message)
        {
            Console.WriteLine($"Message Received: {message}");
            List <LED> displayMessage = Lights.CreateLightPattern(message);

            if (displayMessage.Count == 0)
            {
                Console.WriteLine("SquareBurst Initiated");
                SquareBurst();
            }
            else
            {
                Console.WriteLine("List of Lights Scanned");
                foreach (LED led in displayMessage)
                {
                    Console.Write($"{led.ID}, ");
                }
                Console.WriteLine();
                DisplayLights(displayMessage);
            }
        }