单片机/MCU论坛
直播中

哈哈哈

11年用户 917经验值
擅长:可编程逻辑
私信 关注
[问答]

如何用c语言编写arduino虚拟串口的驱动程序?

  用c语言编写arduino虚拟串口的驱动程序   

回帖(3)

冯敏敏

2023-10-25 17:26:05
网上有专门的虚拟串口软件,不需要自己写的    
举报

李艳

2023-10-25 17:26:11
虚拟串口一般是针对上位机说的,一般没人用c开发,再说大多数情况,用现成的虚拟串口软件就行。
举报

刘建华

2023-10-25 17:26:17
  举个例子,定义一个软串口在10和11引脚
其中10是rx,11是tx
波特率9600

// include the SoftwareSerial library so you can use its functions:#include #define rxPin 10#define txPin 11// set up a new serial portSoftwareSerial mySerial =  SoftwareSerial(rxPin txPin);void setup()  {  // define pin modes for tx rx:  pinMode(rxPin INPUT);  pinMode(txPin OUTPUT);  // set the data rate for the SoftwareSerial port  mySerial.begin(9600);}void loop() {  // ...}      
举报

更多回帖

发帖
×
20
完善资料,
赚取积分