Return to SDK Examples for Microchip Studio
28#define inputPin ConnectorDI6
37#define SerialPort ConnectorUsb
41 inputPin.Mode(Connector::INPUT_DIGITAL);
47 SerialPort.Mode(Connector::USB_CDC);
48 SerialPort.Speed(baudRate);
49 uint32_t timeout = 5000;
51 SerialPort.PortOpen();
52 while (!SerialPort &&
Milliseconds() - startTime < timeout) {
58 state = inputPin.State();
61 SerialPort.Send(
"DI-6 Input state: ");
63 SerialPort.SendLine(
"ON");
66 SerialPort.SendLine(
"OFF");
void Delay_ms(uint32_t ms)
Blocks operations for ms milliseconds.
Definition SysTiming.h:287
uint32_t Milliseconds(void)
Number of milliseconds since the ClearCore was initialized.