private static void dataIn(object sender, SerialDataReceivedEventArgs e)
        {
            int command = port.ReadByte();

            Console.WriteLine("Command: " + command);
            switch (command)
            {
            case 0x01:
                if (SpotifyLoad.connected)
                {
                    Console.WriteLine("Pausing");
                    SpotifyLoad.pausePlay();
                }
                break;

            case 0x05:
                Console.WriteLine("0x05");
                SpotifyLoad.api.GetPlayback().Device.VolumePercent++;
                break;

            case 0x06:
                Console.WriteLine("0x06");
                SpotifyLoad.api.GetPlayback().Device.VolumePercent--;
                break;
            }
        }
Example #2
0
        public UI()
        {
            InitializeComponent();
            setupCustomFont();
            SpotifyLoad spotify = new SpotifyLoad();

            spotify.OnAudioChange += trackChanged;

            ArduinoInterface arduinoInterface = new ArduinoInterface();
            AudioPassthrough ap = new AudioPassthrough();

            if (arduinoInterface.hasError)
            {
                RefreshButton.Visible = true;
            }
            else
            {
                ArduinoInterface.BeginSerial();
                ConnectionLabel.Text = ArduinoInterface.DeviceInfo.Item1;
            }
        }