Example #1
0
        // The main form is closing, clear the bargraph display
        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            for (int ledNumber = 0; ledNumber < 16; ledNumber++)
            {
                outputLedInformation(ledNumber, 0, 0, 0);
            }

            // Send the USB command to the device
            theRgbBargraphDevice.writeLedBrightness();

            byte[] buff = new byte[1];
            buff[0] = 0x00;

            try
            {
                serSerialPort.Write(buff, 0, 1);
                serSerialPort.Close();
            }
            catch (Exception fu)
            {
            }
        }