C#做的串口示波器,可以实现动态波形显示的效果。
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.IO.Ports; using System.Text.RegularExpressions;
namespace serial1 { public partial class Form1 : Form {
int maxRate; //最大比例 private bool listening = false; private bool closing = false;
Point lastPoint,nowPoint; List<double> l = new List<double>(); //存储串口接收的值 Graphics g; //生成图形 Pen drawPen=new Pen(Color.Red,1); private StringBuilder |