|
|
@@ -126,6 +126,7 @@
|
|
|
//U8G2_IST3020_ERC19264_1_8080 u8g2(U8G2_R0, 44, 43, 42, 41, 40, 39, 38, 37, /*enable=*/ 29, /*cs=*/ 32, /*dc=*/ 30, /*reset=*/ 31); // Connect RD pin with 3.3V
|
|
|
//U8G2_IST3020_ERC19264_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
|
|
|
//U8G2_LC7981_160X80_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND
|
|
|
+//U8G2_LC7981_160X160_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND
|
|
|
//U8G2_LC7981_240X128_1_6800 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 18, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RW with GND
|
|
|
//U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
|
|
|
//U8G2_T6963_256X64_1_8080 u8g2(U8G2_R0, 8, 9, 10, 11, 4, 5, 6, 7, /*enable=*/ 17, /*cs=*/ 14, /*dc=*/ 15, /*reset=*/ 16); // Connect RD with +5V, FS0 and FS1 with GND
|
|
|
@@ -280,6 +281,75 @@ void u8g2_xor(uint8_t a) {
|
|
|
|
|
|
}
|
|
|
|
|
|
+#define cross_width 24
|
|
|
+#define cross_height 24
|
|
|
+static const unsigned char cross_bits[] U8X8_PROGMEM = {
|
|
|
+ 0x00, 0x18, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x42, 0x00,
|
|
|
+ 0x00, 0x42, 0x00, 0x00, 0x42, 0x00, 0x00, 0x81, 0x00, 0x00, 0x81, 0x00,
|
|
|
+ 0xC0, 0x00, 0x03, 0x38, 0x3C, 0x1C, 0x06, 0x42, 0x60, 0x01, 0x42, 0x80,
|
|
|
+ 0x01, 0x42, 0x80, 0x06, 0x42, 0x60, 0x38, 0x3C, 0x1C, 0xC0, 0x00, 0x03,
|
|
|
+ 0x00, 0x81, 0x00, 0x00, 0x81, 0x00, 0x00, 0x42, 0x00, 0x00, 0x42, 0x00,
|
|
|
+ 0x00, 0x42, 0x00, 0x00, 0x24, 0x00, 0x00, 0x24, 0x00, 0x00, 0x18, 0x00, };
|
|
|
+
|
|
|
+#define cross_fill_width 24
|
|
|
+#define cross_fill_height 24
|
|
|
+static const unsigned char cross_fill_bits[] U8X8_PROGMEM = {
|
|
|
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x64, 0x00, 0x26,
|
|
|
+ 0x84, 0x00, 0x21, 0x08, 0x81, 0x10, 0x08, 0x42, 0x10, 0x10, 0x3C, 0x08,
|
|
|
+ 0x20, 0x00, 0x04, 0x40, 0x00, 0x02, 0x80, 0x00, 0x01, 0x80, 0x18, 0x01,
|
|
|
+ 0x80, 0x18, 0x01, 0x80, 0x00, 0x01, 0x40, 0x00, 0x02, 0x20, 0x00, 0x04,
|
|
|
+ 0x10, 0x3C, 0x08, 0x08, 0x42, 0x10, 0x08, 0x81, 0x10, 0x84, 0x00, 0x21,
|
|
|
+ 0x64, 0x00, 0x26, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
|
|
+
|
|
|
+#define cross_block_width 14
|
|
|
+#define cross_block_height 14
|
|
|
+static const unsigned char cross_block_bits[] U8X8_PROGMEM = {
|
|
|
+ 0xFF, 0x3F, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20,
|
|
|
+ 0xC1, 0x20, 0xC1, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20,
|
|
|
+ 0x01, 0x20, 0xFF, 0x3F, };
|
|
|
+
|
|
|
+void u8g2_bitmap_overlay(uint8_t a) {
|
|
|
+ uint8_t frame_size = 28;
|
|
|
+
|
|
|
+ u8g2.drawStr(0, 0, "Bitmap overlay");
|
|
|
+
|
|
|
+ u8g2.drawStr(0, frame_size + 12, "Solid / transparent");
|
|
|
+ u8g2.setBitmapMode(false /* solid */);
|
|
|
+ u8g2.drawFrame(0, 10, frame_size, frame_size);
|
|
|
+ u8g2.drawXBMP(2, 12, cross_width, cross_height, cross_bits);
|
|
|
+ if(a & 4)
|
|
|
+ u8g2.drawXBMP(7, 17, cross_block_width, cross_block_height, cross_block_bits);
|
|
|
+
|
|
|
+ u8g2.setBitmapMode(true /* transparent*/);
|
|
|
+ u8g2.drawFrame(frame_size + 5, 10, frame_size, frame_size);
|
|
|
+ u8g2.drawXBMP(frame_size + 7, 12, cross_width, cross_height, cross_bits);
|
|
|
+ if(a & 4)
|
|
|
+ u8g2.drawXBMP(frame_size + 12, 17, cross_block_width, cross_block_height, cross_block_bits);
|
|
|
+}
|
|
|
+
|
|
|
+void u8g2_bitmap_modes(uint8_t transparent) {
|
|
|
+ const uint8_t frame_size = 24;
|
|
|
+
|
|
|
+ u8g2.drawBox(0, frame_size * 0.5, frame_size * 5, frame_size);
|
|
|
+ u8g2.drawStr(frame_size * 0.5, 50, "Black");
|
|
|
+ u8g2.drawStr(frame_size * 2, 50, "White");
|
|
|
+ u8g2.drawStr(frame_size * 3.5, 50, "XOR");
|
|
|
+
|
|
|
+ if(!transparent) {
|
|
|
+ u8g2.setBitmapMode(false /* solid */);
|
|
|
+ u8g2.drawStr(0, 0, "Solid bitmap");
|
|
|
+ } else {
|
|
|
+ u8g2.setBitmapMode(true /* transparent*/);
|
|
|
+ u8g2.drawStr(0, 0, "Transparent bitmap");
|
|
|
+ }
|
|
|
+ u8g2.setDrawColor(0);// Black
|
|
|
+ u8g2.drawXBMP(frame_size * 0.5, 24, cross_width, cross_height, cross_bits);
|
|
|
+ u8g2.setDrawColor(1); // White
|
|
|
+ u8g2.drawXBMP(frame_size * 2, 24, cross_width, cross_height, cross_bits);
|
|
|
+ u8g2.setDrawColor(2); // XOR
|
|
|
+ u8g2.drawXBMP(frame_size * 3.5, 24, cross_width, cross_height, cross_bits);
|
|
|
+}
|
|
|
+
|
|
|
uint8_t draw_state = 0;
|
|
|
|
|
|
void draw(void) {
|
|
|
@@ -296,6 +366,9 @@ void draw(void) {
|
|
|
case 8: u8g2_ascii_2(); break;
|
|
|
case 9: u8g2_extra_page(draw_state&7); break;
|
|
|
case 10: u8g2_xor(draw_state&7); break;
|
|
|
+ case 11: u8g2_bitmap_modes(0); break;
|
|
|
+ case 12: u8g2_bitmap_modes(1); break;
|
|
|
+ case 13: u8g2_bitmap_overlay(draw_state&7); break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -329,10 +402,10 @@ void loop(void) {
|
|
|
|
|
|
// increase the state
|
|
|
draw_state++;
|
|
|
- if ( draw_state >= 11*8 )
|
|
|
+ if ( draw_state >= 14*8 )
|
|
|
draw_state = 0;
|
|
|
|
|
|
// delay between each page
|
|
|
- delay(100);
|
|
|
+ delay(150);
|
|
|
|
|
|
}
|