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:stm32:emb6_1 [2024/04/20 13:24] ktokarzen:iot-open:practical:hardware:sut:stm32:emb6_1 [2024/04/20 13:34] (current) ktokarz
Line 27: Line 27:
 Check if you can see a full ePaper Display in your video stream. Book a device and create a dummy Arduino file with ''void setup()...'' and ''void loop()...''. Check if you can see a full ePaper Display in your video stream. Book a device and create a dummy Arduino file with ''void setup()...'' and ''void loop()...''.
  
-Prepare a small bitmap (e.g. 60x60 pixels) and convert it to the byte array with b/w settings.\\+Prepare a small bitmap (e.g. 64x64 pixels) and convert it to the byte array with b/w settings.\\
 Sample project favicon you can use is present in Figure {{ref>iotopenfavicon}}: Sample project favicon you can use is present in Figure {{ref>iotopenfavicon}}:
 <figure iotopenfavicon> <figure iotopenfavicon>
-{{ :en:iot-open:practical:hardware:sut:esp32:logo_60.jpg?60 |}} +{{ :en:iot-open:practical:hardware:sut:stm32:logo64.png?64 |}} 
-<caption>IOT-OPEN.EU Reloaded favicon 60px 60px</caption>+<caption>IOT-OPEN.EU Reloaded favicon 64px 64px</caption>
 </figure> </figure>
  
Line 72: Line 72:
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
-}; 
- 
-// Total bytes used to store images in PROGMEM = 496 
-const int epd_bitmap_allArray_LEN = 1; 
-const unsigned char* epd_bitmap_allArray[1] = { 
- epd_bitmap_logo_64 
 }; };
 </code> </code>
Line 143: Line 137:
 Declare GPIOs and some configurations needed to handle the ePaper display properly: Declare GPIOs and some configurations needed to handle the ePaper display properly:
 <code c> <code c>
-#define GxEPD2_DRIVER_CLASS GxEPD2_213_BN+// The epaper display's model is selected 
 +#define GxEPD2_DRIVER_CLASS GxEPD2_213_BN 
 #define GxEPD2_DISPLAY_CLASS GxEPD2_BW #define GxEPD2_DISPLAY_CLASS GxEPD2_BW
  
 +// Definition of GPIOs except SPI pins
 #define EPAPER_DC_PIN D4 #define EPAPER_DC_PIN D4
 #define EPAPER_CS_PIN D1 #define EPAPER_CS_PIN D1
Line 151: Line 147:
 #define EPAPER_BUSY_PIN D7 #define EPAPER_BUSY_PIN D7
  
 +// Definition of the size of the buffer
 #define MAX_DISPLAY_BUFFER_SIZE 65536ul  #define MAX_DISPLAY_BUFFER_SIZE 65536ul 
 #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8)) #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
Line 163: Line 160:
 You can also declare a message to display as an array of characters: You can also declare a message to display as an array of characters:
 <code c> <code c>
-static const char HelloWorld[] = "Hello IoT World!";+static const char HelloWorldMsg[] = "Hello IoT World!";
 </code> </code>
  
Line 194: Line 191:
 <code c> <code c>
 int16_t tbx, tby; uint16_t tbw, tbh; int16_t tbx, tby; uint16_t tbw, tbh;
-display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);+display.getTextBounds(HelloWorldMsg, 0, 0, &tbx, &tby, &tbw, &tbh);
  
-uint16_t x = ((display.width() - tbw) / 2) - tbx; +uint16_t x = ((display.width() - tbw) / 2) - tbx;  //center in x arrow 
-uint16_t y = ((display.height() - tbh) / 2) - tby;+uint16_t y = ((display.height() - tbh) / 4) - tby; //one fourth from the top
 </code> </code>
  
Line 204: Line 201:
 <code c> <code c>
 display.setFullWindow(); display.setFullWindow();
-display.firstPage(); +display.fillScreen(GxEPD_WHITE); 
-do +display.setCursor(xy); 
-  { +display.print(HelloWorldMsg); 
-    display.drawImage((uint8_t*)epd_bitmap_logo_60,0,0,60,60); +display.display(true); 
-    display.setCursor(x, y); +display.drawImage((uint8_t*)epd_bitmap_logo_64,0,0,64,64);
-    display.print(HelloWorld); +
-  } +
-while (display.nextPage());+
 digitalWrite(EPAPER_SPI_CS_PIN,HIGH); digitalWrite(EPAPER_SPI_CS_PIN,HIGH);
 </code> </code>
en/iot-open/practical/hardware/sut/stm32/emb6_1.1713619477.txt.gz · Last modified: 2024/04/20 13:24 by ktokarz
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