<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Lesson 1.1. LCD. Graphics]]></title><description><![CDATA[<p dir="auto"><strong>This lesson focuses on the integrated LCD display. We consider the main functions for working with graphics M5Stack.</strong></p>
<p dir="auto"><strong>Step 1. Learn the codes of the colors in the 565 format in figure 1;</strong></p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b53f/7ku861ERf9Y.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 1. Codes the main color in hexadecimal</p>
<p dir="auto"><strong>Step 2. Learn the functions for work with display in list 2;</strong></p>
<p dir="auto">List 2. Functions for working with built-in LCD display</p>
<ul>
<li>M5.Lcd.setBrightness(uint8_t brightness); Set the screen brightness</li>
<li>M5.Lcd.drawPixel(int16_t x, int16_t y, uint16_t color); Paint the pixel located at the X and Y coordinates (relative to the upper left corner of the screen) to a color from 0 to 65535</li>
<li>M5.Lcd.drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color); Draw a line from the point X0 and Y0 to the point X1 and Y1 with a color from 0 to 65535</li>
<li>M5.Lcd.fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); Draw a rectangle with the points X0 and Y0 to the point X1 and Y1 with width W, height H and color from 0 to 65535</li>
<li>M5.Lcd.fillScreen(uint16_t color); Paint the whole screen with color 0 to 65535</li>
<li>M5.Lcd.drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color); Draw a circle with center at the point X0 and Y0, with radius R and color from 0 to 65535</li>
<li>M5.Lcd.drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,uint16_t color); Draw a quarter circle with the center at the point X0 and Y0, with radius R, and a quarter C, and a color from 0 to 65535</li>
<li>M5.Lcd.fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color); Draw a filled circle with center at the point X0 and Y0, with radius R and color from 0 to 65535</li>
<li>M5.Lcd.fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,int16_t delta, uint16_t color); Draw a filled quarter circle with the center at the point X0 and Y0, with radius R, the fourth from 0 to 255 and color from 0 to 65535</li>
<li>M5.Lcd.drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); Draw a triangle with vertices X0 and Y0, X1 and Y1, X2 and Y2 and the color from 0 to 65535</li>
<li>M5.Lcd.fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color); Draw a filled triangle with vertices X0 and Y0, X1 and Y1, X2 and Y2 and the color from 0 to 65535</li>
<li>M5.Lcd.drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); Draw a rectangle with the points X0 and Y0 of width W, height H, radius of the rounded corners R and the color from 0 to 65535</li>
<li>M5.Lcd.fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h, int16_t radius, uint16_t color); Draw a filled rectangle with the points X0 and Y0 of width W, height H, radius of the rounded corners R and the color from 0 to 65535</li>
<li>M5.Lcd.drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color); Draw bitmap with points X0 and Y0, the bit array of brightness from 0 to 255, width W, height H and color from 0 to 65535</li>
<li>M5.Lcd.drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[], int16_t w, int16_t h); Draw a colored bitmap from the point X0 and Y0, an array of the color bit from 0 to 65536, width W, height H</li>
<li>M5.Lcd.drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size); to Draw a character with points X0 and Y0, with the character code C, color from 0 to 65535, background color, from 0 to 65535 in size from 0 to 256</li>
<li>M5.Lcd.setCursor(int x, int y) Set the location of the cursor to the coordinates X and Y</li>
<li>M5.Lcd.setTextColor(uint16_t color); to Set the text color from 0 to 65535</li>
<li>M5.Lcd.setTextColor(uint16_t color, uint16_t backgroundcolor); Set the color of the text from 0 to 65535, and the background color behind it 0 to 65535</li>
<li>M5.Lcd.setTextSize(uint8_t size); to Set the size of text from 0 to 255</li>
<li>M5.Lcd.setTextWrap(boolean w); Use the wrap text to true or false</li>
<li>M5.Lcd.printf(); Display the text on the screen</li>
</ul>
<p dir="auto"><strong>Step 2. Create a new sketch in the Arduino IDE. On the File menu, select New (Fig. 2);</strong></p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b546/Of6NaUGC2J0.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 2. Create a new sketch</p>
<p dir="auto"><strong>Step 3. Draw on the screen shaded in different colors on the circle (Fig. 3).</strong></p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b54f/rnQ_W_NT8bk.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 3. The sketch</p>
<p dir="auto"><strong>Step 4. Click the Upload button (Fig. 4) in order to flash the device;</strong></p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b556/6ET8REQao8I.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 4. Download the firmware to the device</p>
<p dir="auto"><strong>Step 5. When the device firmware is completed, the device screen will display a circle of different colors (Fig. 5 - 5.2).</strong></p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b574/6-OFzduh5WA.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 5. The orange circle</p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b560/IMuFByie3ks.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 5.1. The green circle</p>
<p dir="auto"><img src="https://pp.userapi.com/c841031/v841031804/4b56a/lrPGFMK2GTM.jpg" alt="alt text" class=" img-fluid img-markdown" /><br />
Figure 5.2. Blue circle</p>
]]></description><link>https://community.m5stack.com/topic/41/lesson-1-1-lcd-graphics</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 05:14:42 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/41.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Dec 2017 06:31:11 GMT</pubDate><ttl>60</ttl></channel></rss>