Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:iot-open:practical:hardware:sut:esp32:emb7_1 [2024/04/09 09:24] – [Steps] pczekalskien:iot-open:practical:hardware:sut:esp32:emb7_1 [2024/06/29 15:54] (current) – [Prerequisites] pczekalski
Line 1: Line 1:
-<todo @pczekalski>Finish it!</todo> 
 ====== EMB7: Using OLED display ===== ====== EMB7: Using OLED display =====
 This scenario presents how to use the OLED display. Our OLED display is an RGB (16bit colour, 64k colours) 1.5in, 128x128 pixels. The OLED chip is SSD1351, and it is controlled over the SPI interface using the following pin configuration: This scenario presents how to use the OLED display. Our OLED display is an RGB (16bit colour, 64k colours) 1.5in, 128x128 pixels. The OLED chip is SSD1351, and it is controlled over the SPI interface using the following pin configuration:
Line 17: Line 16:
 <code ini> <code ini>
 lib_deps =  lib_deps = 
-    adafruit/Adafruit SSD1351 library@^1.2.8+    adafruit/Adafruit SSD1351 library@^1.3.2
     adafruit/Adafruit GFX Library@^1.11.9     adafruit/Adafruit GFX Library@^1.11.9
 </code> </code>
Line 195: Line 194:
 <note tip>To speed up screen updating and avoid flickering, you may use a trick to clear the afore-written text: instead of clearing the whole or partial screen, write the same text in the same location but in the background colour.</note> <note tip>To speed up screen updating and avoid flickering, you may use a trick to clear the afore-written text: instead of clearing the whole or partial screen, write the same text in the same location but in the background colour.</note>
  
-<todo @pczekalskiWrite about printing in the context of the println</todo>+<note tip>Using ''println(...)'' to print the text is very handy as once executed, ''setCursor'' is automatically called to set the cursor in the next line so you can continue printing in a new line without a need to set the cursor's position explicitly. Use ''print(...)'' to continue printing in the current line.</note> 
 + 
 +Besides the functions presented above, the controller class has several other handy functions (among others): 
 +  * ''drawPixel(x,y, colour)'' draws a pixel in ''x,y'' coordinates of the ''colour'' colour, 
 +  * ''drawCircle(x,y, radius, colour)'' draws a circle in ''x,y'' coordinates with colour ''colour'' and specified ''radius'' (in pixels), 
 +  * ''drawLine(x1,y1, x2,y2, colour)'' draws a line starting from ''x1,y1'' and finished in ''x2,y2'' with given ''colour'' - to draw straight (horizontal or vertical) lines there is a faster option: 
 +    * ''drawFastHLine(x,y, w, colour)'' draws horizontal line that starts from ''x,y'' and of the length ''w'' with given ''colour'', 
 +    * ''drawFastVLine(x,y, h, colour)'' draws vertical line that starts from ''x,y'' and of the length ''h'' with given ''colour'', 
 +  * ''drawRect(x,y, w,h, colour)'' draws a rectange starting in ''x,y'' of the width and height ''w'' and ''h'' and with given ''colour'' (no fill), 
 +  * ''drawTriangle(x1,y1, x2,y2, x3,y3, colour)'' draws a triangle using 3 vertexes and of given colour (no fill), 
  
 ==== Result validation ==== ==== Result validation ====
Line 201: Line 210:
  
 ===== FAQ ===== ===== FAQ =====
-This section is to be extended as new questions appear\\ +**The screen is black even if I write to itWhat to do?**: Check if you have initialised an SPI communication object and pulled the "chip select" GPIO down to LOW before drawing. Follow the code example in this manualit does work!
-When using the printed version of this manual, please refer to the latest online version of this document to obtain the valid and up-to-date list of the FAQ. +
-//Provide some FAQs in the following form:\\ +
-**Question?**: Answer. +
-//+
  
 +
 +<WRAP noprint>
 ===== Project information ===== ===== Project information =====
 {{:en:iot-open:logo_iot_200_px.png?200|}}\\ {{:en:iot-open:logo_iot_200_px.png?200|}}\\
Line 223: Line 230:
 {{:en:iot-open:ccbync.png?100|}} {{:en:iot-open:ccbync.png?100|}}
 </figure> </figure>
- +</WRAP>
- +
en/iot-open/practical/hardware/sut/esp32/emb7_1.1712654695.txt.gz · Last modified: 2024/04/09 09:24 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0