zoukankan      html  css  js  c++  java
  • led

    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();
    }
    }
    }

  • 相关阅读:
    20150316--TP-01
    20150314--TP-02
    20150314--TP-01
    20150313+微信-全
    表单/iframe与video标签
    图像/超链接标签
    HTML列表与表格
    JAVA新的一天
    MySQL常用函数
    php基础--来自网页转载
  • 原文地址:https://www.cnblogs.com/https/p/9183226.html
Copyright © 2011-2022 走看看