# 3.1. Inkplate Peripheral Mode¶

Peripheral mode for Inkplate by Soldered Peripheral mode is uploaded to each Inkplate. It enables you to use the board without reprogramming. You just need to send commands via UART and it will show contents on its screen. You can send commands via USB port or by directly connecting to ESP32 TX and RX pins.

Don’t forget you need to send #L(1)* after each command to show it on the display (equal to display.display()). Peripheral mode Arduino code for all inkplates can be found under examples/other if needed to be installed again.

Settings are: 115200 baud, standard parity, ending with \n\r

## 3.1.1. echo: #?*¶

Check if the Inkplate receives commands on UARTResponse: OK

## 3.1.2. drawPixel: #0(XXX,YYY,CC)*¶

XXX - X coordinate (with leading zeros)YYY - Y coordinate (with leading zeros)CC - Color (with leading zeros)example:

```
#0(001,005,04)*
```

## 3.1.3. drawLine: #1(XXX,YYY,III,JJJ,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)III - End x coordinate (with leading zeros)JJJ - End y coordinate (with leading zeros)CC - Color (with leading zeros)example:

```
#1(001,004,010,123,01)*
```

## 3.1.4. drawFastVLine: #2(XXX,YYY,LLL,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)LLL - Length of line (with leading zeros)CC - Solor (with leading zeros)example:

```
#2(142,425,040,05)*
```

## 3.1.5. drawFastHLine: #3(XXX,YYY,LLL,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)LLL - Length of line (with leading zeros)CC - Color (with leading zeros)example:

```
#3(123,014,100,03)*
```

## 3.1.6. drawRect: #4(XXX,YYY,WWW,HHH,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)CC - Color (with leading zeros)example:

```
#4(123,014,050,010,01)*
```

## 3.1.7. drawCircle: #5(XXX,YYY,RRR,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRR - Radius of circle (with leading zeros)CC - Color (with leading zeros)example:

```
#5(050,100,040,01)*
```

## 3.1.8. drawTriangle: #6(XX1,YY1,XX2,YY2,XX3,YY3,CC)*¶

XX1 - X coordinate of first corner (with leading zeros)YY1 - Y coordinate of first corner (with leading zeros)XX2 - X coordinate of second corner (with leading zeros)YY2 - Y coordinate of second corner (with leading zeros)XX3 - X coordinate of third corner (with leading zeros)YY3 - Y coordinate of third corner (with leading zeros)CC - Color (with leading zeros)example:

```
#6(250,250,100,400,375,450,04)*
```

## 3.1.9. drawRoudRect: #7(XXX,YYY,WWW,HHH,RRR,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)RRR - Radius (with leading zeros)CC - Color (with leading zeros)example:

```
#7(123,014,050,010,005,00)*
```

## 3.1.10. fillRect: #8(XXX,YYY,WWW,HHH,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)CC - Color (with leading zeros)example:

```
#8(123,014,050,010,01)*
```

## 3.1.11. fillCircle: #9(XXX,YYY,RRR,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRR - Radius of circle (with leading zeros)CC - Color (with leading zeros)example:

```
#9(050,100,040,01)*
```

## 3.1.12. fillTriangle: #A(XX1,YY1,XX2,YY2,XX3,YY3,CC)*¶

XX1 - X coordinate of first corner (with leading zeros)YY1 - Y coordinate of first corner (with leading zeros)XX2 - X coordinate of second corner (with leading zeros)YY2 - Y coordinate of second corner (with leading zeros)XX3 - X coordinate of third corner (with leading zeros)YY3 - Y coordinate of third corner (with leading zeros)CC - Color (with leading zeros)example:

```
#A(250,250,100,400,375,450,04)*
```

## 3.1.13. fillRoudRect: #B(XXX,YYY,WWW,HHH,RRR,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)WWW - Width of rect. (with leading zeros)HHH - Height of rect. (with leading zeros)RRR - Radius (with leading zeros)CC - Color (with leading zeros)example:

```
#B(123,014,050,010,005,00)*
```

## 3.1.14. print: #C(“STRING”)*¶

STRING - Text/Strig coded in HEX Char (example: HELLO WORLD would be coded like 48454c4c4f20574f524c44, where 48 means 0x48 which is H in ASCII table)example: for HELLO WORLD:

```
#C("48454c4c4f20574f524c44")*
```

## 3.1.16. setCursor: #E(XXX,YYY)*¶

XXX - X position of text cursor (with leading zeros)YYY - Y position of text cursor (with leading zeros)example:

```
#E(002,010)*
```

## 3.1.17. setTextWrap: #F(T/F)*¶

T - True if enable text wrapingF - False if disable text wrapingexample:

```
#F(T)* or #F(F)*
```

## 3.1.18. setRotation: #G(RRR)*¶

RRR - Sets rotation (0-3, where each increment rotates whole screen by 90 deg)example:

```
#G(003)*
```

## 3.1.19. drawBitmap: #H(XXX,YYY,”PATH”)*¶

XXX - X position of bitmap on displayYYY - Y position of bitmap on displayPATH - path to bitmap image on SD card, where path should be sent as HEX Char (same as for print command). Example: /image1.bmp should be sent as 2f696d616765312e626d70example: (2f696d616765312e626d70 means /image1.bmp)

```
#H(000,000,"2f696d616765312e626d70")*
| Response:
```

```
#H(1)* - Image loaded succesfully
#H(0)* - Image load failed
#H(-1)* - SD Card Init Error
```

Note: This will not work on Inkplate 2, because it has no SD card slot

## 3.1.20. setDisplayMode: #I(D)*¶

D - Display Mode (D = 3 -> 3 bit mode, D = 1 -> 1 bit mode)example:

```
#I(3)* or #I(1)*
```

Note: This will not work on Inkplate 2, because it doesnt’t support grayscale

## 3.1.22. clearDisplay: #K(1)*¶

Clears display.

## 3.1.23. display: #L(1)*¶

Displays image buffer data to screen.

## 3.1.24. partialUpdate: #M(YY1, XX2, YY2)*¶

YY1 - Start Y position of part of the screen that will be updatedXX2 - End X position of part of the screen that will be updatedYY2 - End Y position of part of the screen that will be updatedexample:

```
#M(005,400,040)*
```

Note: This will not work on Inkplate 2, because it has no partialUpdate support

## 3.1.25. readTemperature: #N(?)*¶

Response:

```
#N(23)* - 23 Celsius degrees
```

Note: Not supported on Inkplate 2

## 3.1.26. readTouchpad: #O(P)*¶

P - Name of pad that needs to be read (1, 2 or 3)Response:

```
#O(1)* for high state of pad
or
#O(0)* for low state of pad
```

Note: Not supported on Inkplate 2

## 3.1.27. readBattery: #P(?)*¶

Response:

```
#P(3.65)* - Measured voltage on battery is 3.65VDC
```

Note: Not supported on Inkplate 2

## 3.1.28. panelSupply(einkOff/on):#Q(S)*¶

S - State of panel power supply (S = 1 -> panel has power supply, S = 0 -> panel power supply has benn turned off)Note: Not supported on Inkplate 2

## 3.1.29. getPanelState: #R(?)*¶

Response:

```
#R(1)* - panel has power supply or #R(0)* - panel supply has been turned off
```

Note: Not supported on Inkplate 2

## 3.1.30. drawImage: #S(XXX,YYY,”PATH”)*¶

XXX - X position of bitmap on displayYYY - Y position of bitmap on displayPATH - path to bitmap image on SD card, where path should be sent as HEX Char (same as for print command). Example: /image1.bmp should be sent as 2f696d616765312e626d70example: (2f696d616765312e626d70 means /image1.bmp)

```
#S(000,000,"2f696d616765312e626d70")*
| Response:
```

Note: This will not work on Inkplate 2, it has no SD card slot

## 3.1.31. drawThickLine: #T(XXX,YYY,III,JJJ,TT,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)III - End x coordinate (with leading zeros)JJJ - End y coordinate (with leading zeros)TT - Line thicknessCC - Color (with leading zeros)example:

```
#T(001,004,010,123,05,01)*
```

## 3.1.32. drawElipse: #U(XXX,YYY,RRX,RRY,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRX - X radius (with leading zeros)RRY - Y radius (with leading zeros)CC - Color (with leading zeros)example:

```
#U(050,100,040,070,01)*
```

## 3.1.33. fillElipse: #V(XXX,YYY,RRX,RRY,CC)*¶

XXX - Start x coordinate (with leading zeros)YYY - Start y coordinate (with leading zeros)RRX - X radius (with leading zeros)RRY - Y radius (with leading zeros)CC - Color (with leading zeros)example:

```
#V(050,100,040,070,01)*
```