Return to SDK Examples for Microchip Studio
29#define InputConnector ConnectorDI6
39#define SerialPort ConnectorUsb
43 InputConnector.Mode(Connector::INPUT_DIGITAL);
49 SerialPort.Mode(Connector::USB_CDC);
50 SerialPort.Speed(baudRate);
51 uint32_t timeout = 5000;
53 SerialPort.PortOpen();
54 while (!SerialPort &&
Milliseconds() - startTime < timeout) {
61 risen = InputConnector.InputRisen();
62 fallen = InputConnector.InputFallen();
64 SerialPort.Send(
"DI-6 Transitions: ");
66 if (risen && fallen) {
67 SerialPort.SendLine(
"RISEN and FALLEN");
70 SerialPort.SendLine(
"RISEN");
73 SerialPort.SendLine(
"FALLEN");
76 SerialPort.SendLine(
"NO CHANGE");
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.