码迷,mamicode.com
首页 > 其他好文 > 详细

led

时间:2018-06-14 18:16:46      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:win   form   orm   port   object   vat   component   forms   IV   

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{

public partial class Form1 : Form
{
Byte[] Btn = new Byte[2];

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
serialPort1.PortName = "COM5";
serialPort1.BaudRate = 4800;
serialPort1.Open();
}

private void button1_Click(object sender, EventArgs e)
{

Btn[0] = 0x01;
this.serialPort1.Write(Btn, 0, 1);

}

private void button2_Click(object sender, EventArgs e)
{
Btn[0] = 0x02;
this.serialPort1.Write(Btn, 0, 1);


}

private void button3_Click(object sender, EventArgs e)
{
serialPort1.Close();
Close();
}
}
}

 

led

标签:win   form   orm   port   object   vat   component   forms   IV   

原文地址:https://www.cnblogs.com/https/p/9183226.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!