YL-KL26Z带有USB接口,可以很方便的做一个USB串口转换器,虽然不太专业,应急用一下还是不错的。#include "mbed.h"
#include "USBSerial.h"
//Virtual serial port over USB
USBSerial serial;
Serial pc(PTE0, PTE1);
int main(void) {
while(1)
{
if(serial.readable())
pc.putc(serial.getc());
if(pc.readable())
serial.putc(pc.getc());
}
}
|