Ver Mensaje Individual
  #2  
Antiguo 10-02-2019
REHome REHome is offline
Miembro
 
Registrado: jul 2003
Ubicación: España
Posts: 454
Reputación: 21
REHome Va por buen camino
Hola:

Por ahora he llegado hasta aquí y funciona.

Código:
public static void brillo()
        {
            ConsoleKey teclaBrillo;
            Console.Clear();
            do
            {
                
                Console.SetCursorPosition(0, 0);
                Console.Write("Luz: ");

                for (int i = 0; i < luz; i++)
                {
                    Console.Write("X");
                }

                for (int j = 0; j < (BRILLO_MAX - luz); j++)
                {
                    Console.Write("-");
                }

                teclaBrillo = Console.ReadKey(true).Key;

                // ¿Se pulsó el cursor arriba?
                if (teclaBrillo == ConsoleKey.UpArrow)
                {
                    //¿no llega al limite?
                    if (luz < BRILLO_MAX)
                    {
                        // Incrementa 1.
                        luz++;
                    }
                }

                if (teclaBrillo == ConsoleKey.DownArrow)
                {
                    if (luz > 0)
                    {
                        // Decremmenta 1.
                        luz--;
                    }
                }

            } while (teclaBrillo != ConsoleKey.Enter);
        }
Por fin, me tenía negro.

Sigo con el resto de las opciones.

Saludos.
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino.
Responder Con Cita