首页 > 其他 > 详细

led

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

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!