Return to SDK Examples for Microchip Studio
28#define baudRateSerialPort 115200
29#define baudRateInputPort 115200
32#define isTtlInputPort false
35#define SerialPort ConnectorUsb
38#define InputPort ConnectorCOM0
45 SerialPort.Mode(Connector::USB_CDC);
46 SerialPort.Speed(baudRateSerialPort);
47 SerialPort.PortOpen();
54 InputPort.Mode(Connector::TTL);
57 InputPort.Mode(Connector::RS232);
59 InputPort.Speed(baudRateInputPort);
67 input = InputPort.CharGet();
72 SerialPort.Send(
"Received: ");
73 SerialPort.SendLine((
char)input);
76 SerialPort.SendLine(
"No data received...");
void Delay_ms(uint32_t ms)
Blocks operations for ms milliseconds.
Definition SysTiming.h:287