コード例 #1
0
        /// <summary>
        /// 控制LED灯
        /// </summary>
        /// <param name="b"></param>
        private void Contrl_LED(byte b)
        {
            DateTime now    = DateTime.Now;
            bool     sender = new Command_Execute(serial_port).ExcuteCommand(new AVR_Command(AVR_Command.LED, b));

            System.Threading.Thread.Sleep(100);
            byte recevie = serial_port.Recevie();

            if (sender && recevie == AVR_Command.AVR_TRUE)
            {
                toolStripStatusLabel1.Text = "LED发送成功! " + now.ToLocalTime();
            }
            else
            {
                toolStripStatusLabel1.Text = "LED发送失败! " + now.ToLocalTime();
            }
        }