Return to SDK Examples for Microchip Studio
34#define SerialPort ConnectorCOM0
37const uint8_t line1[21] =
"abcdefghijklmnopqrst";
38const uint8_t line2[21] =
"ABCDEFGHIJKLMNOPQRST";
39const uint8_t line3[21] =
"01234567890123456789";
40const uint8_t line4[21] =
"98765432109876543210";
43void SetBrightness(uint8_t level);
44void SetCursor(uint8_t row, uint8_t column);
47 SerialPort.Mode(Connector::TTL);
48 SerialPort.Speed(baudRate);
49 SerialPort.PortOpen();
64 SerialPort.Send((
char *)line1);
65 SerialPort.Send((
char *)line3);
66 SerialPort.Send((
char *)line2);
67 SerialPort.Send((
char *)line4);
82void SetBrightness(uint8_t level) {
83 SerialPort.SendChar(0xfe);
84 SerialPort.SendChar(0x53);
85 SerialPort.SendChar(level);
102void SetCursor(uint8_t row, uint8_t column) {
104 if (row >= NUM_ROWS) {
108 if (column >= NUM_COLUMNS) {
112 uint8_t position = row * NUM_COLUMNS + column;
113 SerialPort.SendChar(0xfe);
114 SerialPort.SendChar(0x45);
115 SerialPort.SendChar(position);