├── Color_LCD_test └── Color_LCD_test.ino ├── README.md ├── color_spectrum └── color_spectrum.ino ├── logo01_240X240.bmp ├── md_pic ├── main.jpg ├── t1.jpg ├── t2.jpg └── t3.jpg ├── pyfonts.rar └── workSpace ├── Color_LCD_test01.py ├── Color_LCD_test02.py ├── Color_LCD_test03.py ├── italicc.py ├── romans.py └── st7789py.py /Color_LCD_test/Color_LCD_test.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SPI.h" 3 | #include 4 | 5 | 6 | #define SPI_CS 15 7 | #define SPI_DC 22 8 | #define SPI_RST 21 9 | #define SPI_SCLK 14 10 | #define SPI_MOSI 13 11 | #define SPI_MISO 12 12 | 13 | 14 | 15 | 16 | //SPI control 17 | #define SPI_ON_TFT digitalWrite(SPI_CS, LOW) 18 | #define SPI_OFF_TFT digitalWrite(SPI_CS, HIGH) 19 | 20 | struct LGFX_Config 21 | { 22 | static constexpr spi_host_device_t spi_host = VSPI_HOST; 23 | static constexpr int dma_channel = 1; 24 | static constexpr int spi_sclk = SPI_SCLK; 25 | static constexpr int spi_mosi = SPI_MOSI; 26 | static constexpr int spi_miso = SPI_MISO; 27 | }; 28 | 29 | static lgfx::LGFX_SPI tft; 30 | static LGFX_Sprite sprite(&tft); 31 | static lgfx::Panel_ST7789 panel; 32 | 33 | uint16_t color[7] = {0x001F,0xf800,0x07e0,0x07ff,0xf81f,0xffe0,0xffff}; 34 | 35 | /***************************************************************************/ 36 | 37 | 38 | void setup() 39 | { 40 | 41 | Serial.begin(115200); 42 | 43 | pinMode(SPI_CS, OUTPUT); 44 | SPI_OFF_TFT; 45 | SPI.begin(SPI_SCLK, SPI_MISO, SPI_MOSI); 46 | 47 | //TFT(SPI) init 48 | 49 | 50 | set_tft(); 51 | tft.begin(); 52 | //tft.init(); 53 | tft.fillScreen(color[6]); 54 | 55 | 56 | //tft.drawLine(0,0, 150,150,color[random(5)]); 57 | //tft.drawLine(30, 40, 200, 40, color[random(3)]); 58 | //tft.fillRect(0,0,20,200,color[random(3)]); 59 | 60 | tft.setCursor(0, 0); 61 | tft.setTextColor(0x07e0); 62 | tft.setTextSize(4); 63 | tft.println("Hello World!"); 64 | } 65 | 66 | void loop() 67 | { 68 | 69 | } 70 | 71 | 72 | void set_tft() 73 | { 74 | // パネルクラスに各種設定値を代入していきます。 75 | // (LCD一体型製品のパネルクラスを選択した場合は、 76 | // 製品に合った初期値が設定されているので設定は不要です) 77 | 78 | // 通常動作時のSPIクロックを設定します。 79 | // ESP32のSPIは80MHzを整数で割った値のみ使用可能です。 80 | // 設定した値に一番近い設定可能な値が使用されます。 81 | panel.freq_write = 60000000; 82 | //panel.freq_write = 20000000; 83 | 84 | // 単色の塗り潰し処理時のSPIクロックを設定します。 85 | // 基本的にはfreq_writeと同じ値を設定しますが、 86 | // より高い値を設定しても動作する場合があります。 87 | panel.freq_fill = 60000000; 88 | //panel.freq_fill = 27000000; 89 | 90 | // LCDから画素データを読取る際のSPIクロックを設定します。 91 | panel.freq_read = 16000000; 92 | 93 | // SPI通信モードを0~3から設定します。 94 | panel.spi_mode = 0; 95 | 96 | // データ読み取り時のSPI通信モードを0~3から設定します。 97 | panel.spi_mode_read = 0; 98 | 99 | // 画素読出し時のダミービット数を設定します。 100 | // 画素読出しでビットずれが起きる場合に調整してください。 101 | panel.len_dummy_read_pixel = 8; 102 | 103 | // データの読取りが可能なパネルの場合はtrueを、不可の場合はfalseを設定します。 104 | // 省略時はtrueになります。 105 | panel.spi_read = true; 106 | 107 | // データの読取りMOSIピンで行うパネルの場合はtrueを設定します。 108 | // 省略時はfalseになります。 109 | panel.spi_3wire = false; 110 | 111 | // LCDのCSを接続したピン番号を設定します。 112 | // 使わない場合は省略するか-1を設定します。 113 | panel.spi_cs = SPI_CS; 114 | 115 | // LCDのDCを接続したピン番号を設定します。 116 | panel.spi_dc = SPI_DC; 117 | 118 | // LCDのRSTを接続したピン番号を設定します。 119 | // 使わない場合は省略するか-1を設定します。 120 | panel.gpio_rst = SPI_RST; 121 | 122 | // LCDのバックライトを接続したピン番号を設定します。 123 | // 使わない場合は省略するか-1を設定します。 124 | // panel.gpio_bl = LCD_BL; 125 | 126 | // バックライト使用時、輝度制御に使用するPWMチャンネル番号を設定します。 127 | // PWM輝度制御を使わない場合は省略するか-1を設定します。 128 | panel.pwm_ch_bl = -1; 129 | 130 | // バックライト点灯時の出力レベルがローかハイかを設定します。 131 | // 省略時は true。true=HIGHで点灯 / false=LOWで点灯になります。 132 | panel.backlight_level = true; 133 | 134 | // invertDisplayの初期値を設定します。trueを設定すると反転します。 135 | // 省略時は false。画面の色が反転している場合は設定を変更してください。 136 | panel.invert = false; 137 | 138 | // パネルの色順がを設定します。 RGB=true / BGR=false 139 | // 省略時はfalse。赤と青が入れ替わっている場合は設定を変更してください。 140 | panel.rgb_order = false; 141 | 142 | // パネルのメモリが持っているピクセル数(幅と高さ)を設定します。 143 | // 設定が合っていない場合、setRotationを使用した際の座標がずれます。 144 | // (例:ST7735は 132x162 / 128x160 / 132x132 の3通りが存在します) 145 | panel.memory_width = 240; 146 | panel.memory_height = 240; 147 | 148 | // パネルの実際のピクセル数(幅と高さ)を設定します。 149 | // 省略時はパネルクラスのデフォルト値が使用されます。 150 | panel.panel_width = 240; 151 | panel.panel_height = 240; 152 | 153 | // パネルのオフセット量を設定します。 154 | // 省略時はパネルクラスのデフォルト値が使用されます。 155 | panel.offset_x = 0; 156 | panel.offset_y = 0; 157 | 158 | // setRotationの初期化直後の値を設定します。 159 | panel.rotation = 0; 160 | 161 | // setRotationを使用した時の向きを変更したい場合、offset_rotationを設定します。 162 | // setRotation(0)での向きを 1の時の向きにしたい場合、 1を設定します。 163 | panel.offset_rotation = 0; 164 | 165 | // 設定を終えたら、LGFXのsetPanel関数でパネルのポインタを渡します。 166 | tft.setPanel(&panel); 167 | } 168 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MakePython-ESP32-Color-LCD 2 | 3 | ```c++ 4 | /* 5 | Version: V2.0 6 | Author: UNKOWN 7 | Create Date: UNKOWN 8 | Note: 9 | 2020/7/24 v2.0: Rebuid readme,add pic. By Vincent 10 | */ 11 | ``` 12 | 13 | [toc] 14 | 15 | # Introduce 16 | 17 | Python is one of the most widely used, simple and easy-to-learn programming languages around. MicroPython is a lean implementation of the Python 3 programming language that has been pared down to run efficiently on microcontrollers. 18 | Makerfabs MakePython ESP32 color LED is development board for IOT applications. Based on ESP32, the boards can act as WIFI node easily; there on-board UART-USB convertors to enable this module to be programmed anytime with a PC. 1.3-inch LCD display screen is suitable for the applications that need colorful displays. 19 | MakePython ESP32 color LED is preloaded with MicroPython, simple and suitable for beginners to learn the basic programming with MicroPython, Of course, users can free to change it to make it work with other platforms such as Arduino/GCC. 20 | 21 | ![main](md_pic/main.jpg) 22 | 23 | - You can get one from: [Makepython-Esp32-Color-Lcd](https://www.makerfabs.com/makepython-esp32-color-lcd.html) 24 | 25 | - Hardware and detailed instructions please visit Wiki page: [Makepython-Esp32-Color-Lcd Wiki](https://wiki.makerfabs.com/MaESP_ESP32_Color_LCD.html) 26 | 27 | # Related Test 28 | 29 | Visit the wiki for details. 30 | 31 | - Display color words. 32 | 33 | ![2](md_pic/t1.jpg) 34 | 35 | - Get network time and display temperature and humidity. 36 | 37 | ![2](md_pic/t2.jpg) 38 | 39 | - Display color pictures. 40 | 41 | ![t3](md_pic/t3.jpg)- 42 | -------------------------------------------------------------------------------- /color_spectrum/color_spectrum.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "SPI.h" 3 | #include 4 | #include "arduinoFFT.h" 5 | 6 | arduinoFFT FFT = arduinoFFT(); 7 | 8 | #define SPI_CS 15 9 | #define SPI_DC 22 10 | #define SPI_RST 21 11 | #define SPI_SCLK 14 12 | #define SPI_MOSI 13 13 | #define SPI_MISO 12 14 | 15 | 16 | //SPI control 17 | #define SPI_ON_TFT digitalWrite(SPI_CS, LOW) 18 | #define SPI_OFF_TFT digitalWrite(SPI_CS, HIGH) 19 | 20 | struct LGFX_Config 21 | { 22 | static constexpr spi_host_device_t spi_host = VSPI_HOST; 23 | static constexpr int dma_channel = 1; 24 | static constexpr int spi_sclk = SPI_SCLK; 25 | static constexpr int spi_mosi = SPI_MOSI; 26 | static constexpr int spi_miso = SPI_MISO; 27 | }; 28 | 29 | static lgfx::LGFX_SPI tft; 30 | static LGFX_Sprite sprite(&tft); 31 | static lgfx::Panel_ST7789 panel; 32 | 33 | uint16_t color[7] = {0x001F,0xf800,0x07e0,0x07ff,0xf81f,0xffe0,0xffff}; 34 | 35 | /***************************************************************************/ 36 | #define SAMPLES 512 // Must be a power of 2 37 | #define SAMPLING_FREQUENCY 40000 // Hz, must be 40000 or less due to ADC conversion time. Determines maximum frequency that can be analysed by the FFT Fmax=sampleF/2. 38 | #define amplitude 200 // Depending on your audio source level, you may need to increase this value 39 | unsigned int sampling_period_us; 40 | unsigned long microseconds; 41 | byte peak[] = {0,0,0,0,0,0,0}; 42 | double vReal[SAMPLES]; 43 | double vImag[SAMPLES]; 44 | unsigned long newTime, oldTime; 45 | 46 | int data_avgs[64]; 47 | 48 | 49 | void setup() 50 | { 51 | 52 | Serial.begin(115200); 53 | while (!Serial) 54 | ; // Leonardo: wait for serial monitor 55 | Serial.println("\n NS2009 test"); 56 | 57 | pinMode(SPI_CS, OUTPUT); 58 | SPI_OFF_TFT; 59 | SPI.begin(SPI_SCLK, SPI_MISO, SPI_MOSI); 60 | 61 | //TFT(SPI) init 62 | SPI_ON_TFT; 63 | 64 | set_tft(); 65 | tft.begin(); 66 | //tft.init(); 67 | tft.fillScreen(color[6]); 68 | SPI_OFF_TFT; 69 | } 70 | 71 | void loop() 72 | { 73 | for (int i = 0; i < SAMPLES; i++) { 74 | newTime = micros()-oldTime; 75 | oldTime = newTime; 76 | vReal[i] = analogRead(34); // A conversion takes about 1uS on an ESP32 77 | vImag[i] = 0; 78 | while (micros() < (newTime + sampling_period_us)) { /* do nothing to wait */ } 79 | } 80 | FFT.Windowing(vReal, SAMPLES, FFT_WIN_TYP_HAMMING, FFT_FORWARD); 81 | FFT.Compute(vReal, vImag, SAMPLES, FFT_FORWARD); 82 | FFT.ComplexToMagnitude(vReal, vImag, SAMPLES); 83 | tft.fillScreen(color[6]); 84 | tft.setCursor(0, 210); 85 | tft.setTextColor(0xf81f); 86 | tft.setTextSize(2); 87 | tft.println("01 02 05 1k 2k 4k 8k "); 88 | for (int i = 2; i < (SAMPLES/2); i++){ // Don't use sample 0 and only the first SAMPLES/2 are usable. 89 | // Each array element represents a frequency and its value, is the amplitude. Note the frequencies are not discrete. 90 | if (vReal[i] > 1500) { // Add a crude noise filter, 10 x amplitude or more 91 | if (i<=2 ) displayBand(0,(int)vReal[i]); // 125Hz 92 | if (i >2 && i<=4 ) displayBand(1,(int)vReal[i]); // 250Hz 93 | if (i >4 && i<=7 ) displayBand(2,(int)vReal[i]); // 500Hz 94 | if (i >7 && i<=15 ) displayBand(3,(int)vReal[i]); // 1000Hz 95 | if (i >15 && i<=40 ) displayBand(4,(int)vReal[i]); // 2000Hz 96 | if (i >40 && i<=70 ) displayBand(5,(int)vReal[i]); // 4000Hz 97 | if (i >70 && i<=288 ) displayBand(6,(int)vReal[i]); // 8000Hz 98 | if (i >288 ) displayBand(7,(int)vReal[i]); // 16000Hz 99 | //Serial.println(i); 100 | } 101 | for (byte band = 0; band <= 7; band++) tft.drawLine(36*band,200-peak[band],36*band+28,200-peak[band],color[4]); 102 | } 103 | if (millis()%2 == 0) {for (byte band = 0; band <= 7; band++) {if (peak[band] > 4) peak[band] -= 4;if (peak[band] < 4) peak[band] = 0;}} // Decay the peak 104 | 105 | } 106 | 107 | void displayBand(int band, int dsize){ 108 | int dmax = 200; 109 | dsize /= amplitude; 110 | if (dsize > dmax) dsize = dmax; 111 | if (band == 7) tft.drawLine(36*6,200, 36*6+28,200,TFT_WHITE); 112 | for (int s = 0; s <= dsize; s=s+8) {tft.fillRect(band*36,200-s, 28, 5, color[random(3)]);} 113 | if (dsize > peak[band]) {peak[band] = dsize;} 114 | } 115 | 116 | 117 | void set_tft() 118 | { 119 | // パネルクラスに各種設定値を代入していきます。 120 | // (LCD一体型製品のパネルクラスを選択した場合は、 121 | // 製品に合った初期値が設定されているので設定は不要です) 122 | 123 | // 通常動作時のSPIクロックを設定します。 124 | // ESP32のSPIは80MHzを整数で割った値のみ使用可能です。 125 | // 設定した値に一番近い設定可能な値が使用されます。 126 | panel.freq_write = 80000000;//60000000; 127 | //panel.freq_write = 20000000; 128 | 129 | // 単色の塗り潰し処理時のSPIクロックを設定します。 130 | // 基本的にはfreq_writeと同じ値を設定しますが、 131 | // より高い値を設定しても動作する場合があります。 132 | panel.freq_fill = 80000000;//60000000; 133 | //panel.freq_fill = 27000000; 134 | 135 | // LCDから画素データを読取る際のSPIクロックを設定します。 136 | panel.freq_read = 16000000; 137 | 138 | // SPI通信モードを0~3から設定します。 139 | panel.spi_mode = 0; 140 | 141 | // データ読み取り時のSPI通信モードを0~3から設定します。 142 | panel.spi_mode_read = 0; 143 | 144 | // 画素読出し時のダミービット数を設定します。 145 | // 画素読出しでビットずれが起きる場合に調整してください。 146 | panel.len_dummy_read_pixel = 8; 147 | 148 | // データの読取りが可能なパネルの場合はtrueを、不可の場合はfalseを設定します。 149 | // 省略時はtrueになります。 150 | panel.spi_read = true; 151 | 152 | // データの読取りMOSIピンで行うパネルの場合はtrueを設定します。 153 | // 省略時はfalseになります。 154 | panel.spi_3wire = false; 155 | 156 | // LCDのCSを接続したピン番号を設定します。 157 | // 使わない場合は省略するか-1を設定します。 158 | panel.spi_cs = SPI_CS; 159 | 160 | // LCDのDCを接続したピン番号を設定します。 161 | panel.spi_dc = SPI_DC; 162 | 163 | // LCDのRSTを接続したピン番号を設定します。 164 | // 使わない場合は省略するか-1を設定します。 165 | panel.gpio_rst = SPI_RST; 166 | 167 | // LCDのバックライトを接続したピン番号を設定します。 168 | // 使わない場合は省略するか-1を設定します。 169 | // panel.gpio_bl = LCD_BL; 170 | 171 | // バックライト使用時、輝度制御に使用するPWMチャンネル番号を設定します。 172 | // PWM輝度制御を使わない場合は省略するか-1を設定します。 173 | panel.pwm_ch_bl = -1; 174 | 175 | // バックライト点灯時の出力レベルがローかハイかを設定します。 176 | // 省略時は true。true=HIGHで点灯 / false=LOWで点灯になります。 177 | panel.backlight_level = true; 178 | 179 | // invertDisplayの初期値を設定します。trueを設定すると反転します。 180 | // 省略時は false。画面の色が反転している場合は設定を変更してください。 181 | panel.invert = false; 182 | 183 | // パネルの色順がを設定します。 RGB=true / BGR=false 184 | // 省略時はfalse。赤と青が入れ替わっている場合は設定を変更してください。 185 | panel.rgb_order = false; 186 | 187 | // パネルのメモリが持っているピクセル数(幅と高さ)を設定します。 188 | // 設定が合っていない場合、setRotationを使用した際の座標がずれます。 189 | // (例:ST7735は 132x162 / 128x160 / 132x132 の3通りが存在します) 190 | panel.memory_width = 240; 191 | panel.memory_height = 240; 192 | 193 | // パネルの実際のピクセル数(幅と高さ)を設定します。 194 | // 省略時はパネルクラスのデフォルト値が使用されます。 195 | panel.panel_width = 240; 196 | panel.panel_height = 240; 197 | 198 | // パネルのオフセット量を設定します。 199 | // 省略時はパネルクラスのデフォルト値が使用されます。 200 | panel.offset_x = 0; 201 | panel.offset_y = 0; 202 | 203 | // setRotationの初期化直後の値を設定します。 204 | panel.rotation = 1; 205 | 206 | // setRotationを使用した時の向きを変更したい場合、offset_rotationを設定します。 207 | // setRotation(0)での向きを 1の時の向きにしたい場合、 1を設定します。 208 | panel.offset_rotation = 0; 209 | 210 | // 設定を終えたら、LGFXのsetPanel関数でパネルのポインタを渡します。 211 | tft.setPanel(&panel); 212 | } 213 | -------------------------------------------------------------------------------- /logo01_240X240.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/logo01_240X240.bmp -------------------------------------------------------------------------------- /md_pic/main.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/md_pic/main.jpg -------------------------------------------------------------------------------- /md_pic/t1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/md_pic/t1.jpg -------------------------------------------------------------------------------- /md_pic/t2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/md_pic/t2.jpg -------------------------------------------------------------------------------- /md_pic/t3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/md_pic/t3.jpg -------------------------------------------------------------------------------- /pyfonts.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Makerfabs/Makerfabs-MakePython-ESP32-Color-LCD/9ef958e36715597c58454b8b3b962744e3a93bfb/pyfonts.rar -------------------------------------------------------------------------------- /workSpace/Color_LCD_test01.py: -------------------------------------------------------------------------------- 1 | import time 2 | import machine 3 | import st7789py as st7789 4 | import uos 5 | import random 6 | 7 | import romans,italicc #Import the font 8 | 9 | fonts = [romans,italicc] #Add fonts to the list 10 | 11 | def pick_item(sequence): 12 | div = 0x3fffffff // len(sequence) 13 | return sequence[random.getrandbits(30) // div] 14 | 15 | bl = machine.Pin(5, machine.Pin.OUT) 16 | bl.value(1) 17 | 18 | spi = machine.SPI(1, baudrate=80000000, polarity=1, phase=0, sck=machine.Pin(14), mosi=machine.Pin(13), miso=machine.Pin(12))#HSPI 19 | 20 | display = st7789.ST7789( 21 | spi, 240, 240, 22 | reset=machine.Pin(21, machine.Pin.OUT), 23 | dc=machine.Pin(22, machine.Pin.OUT), 24 | cs=machine.Pin(15, machine.Pin.OUT), 25 | backlight=machine.Pin(5, machine.Pin.OUT), 26 | ) 27 | display.init() #initialize 28 | display.fill(st7789.BLACK) 29 | 30 | row = 0 31 | again = True 32 | try: 33 | while again: 34 | #Set RGB565 random color 35 | color = st7789.color565( 36 | random.getrandbits(8), 37 | random.getrandbits(8), 38 | random.getrandbits(8)) 39 | 40 | row += 32 41 | #Displays random color words 42 | display.text(pick_item(fonts), "Makepython!!!", row, 0, color) 43 | 44 | if row > 192: 45 | display.fill(st7789.BLACK) 46 | row = 0 47 | 48 | except KeyboardInterrupt: 49 | pass 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /workSpace/Color_LCD_test02.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import time 3 | import machine 4 | import st7789py as st7789 5 | import uos 6 | import random 7 | import network 8 | import urequests 9 | import ujson 10 | import romans 11 | from machine import Pin 12 | import dht 13 | 14 | fonts = [romans] 15 | bl = machine.Pin(5, machine.Pin.OUT) 16 | bl.value(1) 17 | spi = machine.SPI(1, baudrate=80000000, polarity=1, phase=0, sck=machine.Pin(14), mosi=machine.Pin(13), miso=machine.Pin(12))#HSPI 18 | 19 | def pick_item(sequence): 20 | div = 0x3fffffff // len(sequence) 21 | return sequence[random.getrandbits(30) // div] 22 | 23 | #Connection Network 24 | wlan=0 25 | def connectWiFi(ssid, passwd): 26 | global wlan 27 | wlan=network.WLAN(network.STA_IF) 28 | wlan.active(True) 29 | wlan.disconnect() 30 | wlan.connect(ssid, passwd) 31 | while(wlan.ifconfig()[0]=='0.0.0.0'): 32 | time.sleep(1) 33 | return True 34 | 35 | #Get real time date 36 | def get_date(): 37 | URL="http://quan.suning.com/getSysTime.do" 38 | res=urequests.get(URL).text 39 | j=ujson.loads(res) 40 | list=j['sysTime2'].split()[0] 41 | #list1=j['sysTime2'].split()[1] 42 | return list 43 | 44 | display = st7789.ST7789( 45 | spi, 240, 240, 46 | reset=machine.Pin(21, machine.Pin.OUT), 47 | dc=machine.Pin(22, machine.Pin.OUT), 48 | cs=machine.Pin(15, machine.Pin.OUT), 49 | backlight=machine.Pin(5, machine.Pin.OUT), 50 | ) 51 | 52 | #Measure the temperature and humidity function 53 | sensor = dht.DHT11(Pin(18)) 54 | def read_sensor(): 55 | global temp, temp_percentage, hum 56 | temp = temp_percentage = hum = 0 57 | try: 58 | sensor.measure() 59 | temp = sensor.temperature() #get temperature 60 | hum = sensor.humidity() #get humidity 61 | if (isinstance(temp, float) and isinstance(hum, float)) or (isinstance(temp, int) and isinstance(hum, int)): 62 | msg = ('{0:3.1f} , {1:3.1f}'.format(temp, hum)) 63 | temp_percentage = (temp+6)/(40+6)*(100) 64 | hum = round(hum, 2) 65 | return(msg) 66 | 67 | except OSError as e: 68 | return('Failed to read') 69 | 70 | display.init() 71 | connectWiFi("Makerfabs", "20160704") #Change the network name and password 72 | 73 | again = True 74 | try: 75 | while again: 76 | #Set a random color 77 | color = st7789.color565( 78 | random.getrandbits(8), 79 | random.getrandbits(8), 80 | random.getrandbits(8)) 81 | #display 82 | display.text(pick_item(fonts), "Makerfabs", 32, 0, color) 83 | display.text(pick_item(fonts), str(get_date()), 64, 0, color) 84 | display.text(pick_item(fonts), "temp / hum", 96, 0, color) 85 | display.text(pick_item(fonts), str(read_sensor()), 128, 0, color) 86 | time.sleep(1) 87 | display.fill(st7789.BLACK) #clear screen 88 | 89 | except KeyboardInterrupt: 90 | pass 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /workSpace/Color_LCD_test03.py: -------------------------------------------------------------------------------- 1 | #code for micropython 1.10 on esp32 2 | #test ok on st7789 TFTLCD 3 | #test ok on st7789 1.3inch TFTLCD using Makepython ESP32_Charlin 4 | import random 5 | 6 | import machine 7 | import st7789py as st7789 8 | import time 9 | from machine import SPI,Pin 10 | 11 | def test_main(filename): 12 | back=machine.Pin(5, machine.Pin.OUT) 13 | back.value(1) 14 | spi = SPI(1, baudrate=40000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))#HSPI 15 | display = st7789.ST7789( 16 | spi, 240, 240, 17 | reset=machine.Pin(21, machine.Pin.OUT), 18 | dc=machine.Pin(22, machine.Pin.OUT), 19 | cs=machine.Pin(15, machine.Pin.OUT), 20 | backlight=machine.Pin(5, machine.Pin.OUT), 21 | ) 22 | display.init() 23 | 24 | display.fill( 25 | st7789.color565( 26 | random.getrandbits(8), 27 | random.getrandbits(8), 28 | random.getrandbits(8), 29 | ), 30 | ) 31 | # Pause 2 seconds. 32 | time.sleep(2) 33 | 34 | f=open(filename, 'rb') #Read binary files 35 | if f.read(2) == b'BM': #header 36 | dummy = f.read(8) #file size(4), creator bytes(4) 37 | offset = int.from_bytes(f.read(4), 'little') 38 | hdrsize = int.from_bytes(f.read(4), 'little') 39 | width = int.from_bytes(f.read(4), 'little') 40 | height = int.from_bytes(f.read(4), 'little') 41 | if int.from_bytes(f.read(2), 'little') == 1: #planes must be 1 42 | depth = int.from_bytes(f.read(2), 'little') 43 | if depth == 24 and int.from_bytes(f.read(4), 'little') == 0:#compress method == uncompressed 44 | print("Image size:", width, "x", height) 45 | rowsize = (width * 3 + 3) & ~3 46 | if height < 0: 47 | height = -height 48 | flip = False 49 | else: 50 | flip = True 51 | w, h = width, height 52 | if w > 240: w = 240 53 | if h > 240: h = 240 54 | #tft._setwindowloc((0,0),(w - 1,h - 1)) 55 | display.set_window(0,0,(w - 1),(h - 1)) 56 | for row in range(h): 57 | if flip: 58 | pos = offset + (height - 1 - row) * rowsize 59 | else: 60 | pos = offset + row * rowsize 61 | if f.tell() != pos: 62 | dummy = f.seek(pos) 63 | for col in range(w): 64 | bgr = f.read(3) 65 | 66 | aColor=st7789.color565(bgr[2], bgr[1], bgr[0]) 67 | colorData = bytearray(2) 68 | colorData[0] = aColor >> 8 69 | colorData[1] = aColor 70 | display.write(None, colorData) 71 | 72 | try: 73 | test_main('logo01_240X240.bmp') #Display pictures 74 | time.sleep(5) 75 | except KeyboardInterrupt: 76 | pass 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /workSpace/italicc.py: -------------------------------------------------------------------------------- 1 | def glyphs(): 2 | return 96 3 | 4 | _font =\ 5 | b'\x00\x4a\x5a\x10\x4d\x58\x55\x46\x54\x47\x52\x53\x20\x52\x55'\ 6 | b'\x47\x52\x53\x20\x52\x55\x46\x56\x47\x52\x53\x20\x52\x50\x59'\ 7 | b'\x4f\x5a\x50\x5b\x51\x5a\x50\x59\x0b\x49\x5b\x50\x46\x4e\x4d'\ 8 | b'\x20\x52\x51\x46\x4e\x4d\x20\x52\x59\x46\x57\x4d\x20\x52\x5a'\ 9 | b'\x46\x57\x4d\x0b\x48\x5d\x53\x42\x4c\x62\x20\x52\x59\x42\x52'\ 10 | b'\x62\x20\x52\x4c\x4f\x5a\x4f\x20\x52\x4b\x55\x59\x55\x28\x48'\ 11 | b'\x5d\x54\x42\x4c\x5f\x20\x52\x59\x42\x51\x5f\x20\x52\x5a\x4a'\ 12 | b'\x59\x4b\x5a\x4c\x5b\x4b\x5b\x4a\x5a\x48\x59\x47\x56\x46\x52'\ 13 | b'\x46\x4f\x47\x4d\x49\x4d\x4b\x4e\x4d\x4f\x4e\x56\x52\x58\x54'\ 14 | b'\x20\x52\x4d\x4b\x4f\x4d\x56\x51\x57\x52\x58\x54\x58\x57\x57'\ 15 | b'\x59\x56\x5a\x53\x5b\x4f\x5b\x4c\x5a\x4b\x59\x4a\x57\x4a\x56'\ 16 | b'\x4b\x55\x4c\x56\x4b\x57\x1f\x46\x5e\x5b\x46\x49\x5b\x20\x52'\ 17 | b'\x4e\x46\x50\x48\x50\x4a\x4f\x4c\x4d\x4d\x4b\x4d\x49\x4b\x49'\ 18 | b'\x49\x4a\x47\x4c\x46\x4e\x46\x50\x47\x53\x48\x56\x48\x59\x47'\ 19 | b'\x5b\x46\x20\x52\x57\x54\x55\x55\x54\x57\x54\x59\x56\x5b\x58'\ 20 | b'\x5b\x5a\x5a\x5b\x58\x5b\x56\x59\x54\x57\x54\x30\x46\x5f\x5b'\ 21 | b'\x4e\x5a\x4f\x5b\x50\x5c\x4f\x5c\x4e\x5b\x4d\x5a\x4d\x59\x4e'\ 22 | b'\x58\x50\x56\x55\x54\x58\x52\x5a\x50\x5b\x4d\x5b\x4a\x5a\x49'\ 23 | b'\x58\x49\x55\x4a\x53\x50\x4f\x52\x4d\x53\x4b\x53\x49\x52\x47'\ 24 | b'\x50\x46\x4e\x47\x4d\x49\x4d\x4b\x4e\x4e\x50\x51\x55\x58\x57'\ 25 | b'\x5a\x5a\x5b\x5b\x5b\x5c\x5a\x5c\x59\x20\x52\x4d\x5b\x4b\x5a'\ 26 | b'\x4a\x58\x4a\x55\x4b\x53\x4d\x51\x20\x52\x4d\x4b\x4e\x4d\x56'\ 27 | b'\x58\x58\x5a\x5a\x5b\x05\x4e\x57\x55\x46\x53\x4d\x20\x52\x56'\ 28 | b'\x46\x53\x4d\x13\x4b\x5a\x5a\x42\x56\x45\x53\x48\x51\x4b\x4f'\ 29 | b'\x4f\x4e\x54\x4e\x58\x4f\x5d\x50\x60\x51\x62\x20\x52\x56\x45'\ 30 | b'\x53\x49\x51\x4d\x50\x50\x4f\x55\x4f\x5a\x50\x5f\x51\x62\x13'\ 31 | b'\x4a\x59\x53\x42\x54\x44\x55\x47\x56\x4c\x56\x50\x55\x55\x53'\ 32 | b'\x59\x51\x5c\x4e\x5f\x4a\x62\x20\x52\x53\x42\x54\x45\x55\x4a'\ 33 | b'\x55\x4f\x54\x54\x53\x57\x51\x5b\x4e\x5f\x08\x4a\x5a\x52\x4c'\ 34 | b'\x52\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57\x4f\x4d\x55\x05'\ 35 | b'\x45\x5f\x52\x49\x52\x5b\x20\x52\x49\x52\x5b\x52\x07\x4d\x58'\ 36 | b'\x50\x5b\x4f\x5a\x50\x59\x51\x5a\x51\x5b\x50\x5d\x4e\x5f\x02'\ 37 | b'\x45\x5f\x49\x52\x5b\x52\x05\x4d\x58\x50\x59\x4f\x5a\x50\x5b'\ 38 | b'\x51\x5a\x50\x59\x02\x47\x5d\x5b\x42\x49\x62\x29\x48\x5d\x54'\ 39 | b'\x46\x51\x47\x4f\x49\x4d\x4c\x4c\x4f\x4b\x53\x4b\x56\x4c\x59'\ 40 | b'\x4d\x5a\x4f\x5b\x51\x5b\x54\x5a\x56\x58\x58\x55\x59\x52\x5a'\ 41 | b'\x4e\x5a\x4b\x59\x48\x58\x47\x56\x46\x54\x46\x20\x52\x54\x46'\ 42 | b'\x52\x47\x50\x49\x4e\x4c\x4d\x4f\x4c\x53\x4c\x56\x4d\x59\x4f'\ 43 | b'\x5b\x20\x52\x51\x5b\x53\x5a\x55\x58\x57\x55\x58\x52\x59\x4e'\ 44 | b'\x59\x4b\x58\x48\x56\x46\x0e\x48\x5d\x54\x4a\x4f\x5b\x20\x52'\ 45 | b'\x56\x46\x50\x5b\x20\x52\x56\x46\x53\x49\x50\x4b\x4e\x4c\x20'\ 46 | b'\x52\x55\x49\x51\x4b\x4e\x4c\x29\x48\x5d\x4f\x4a\x50\x4b\x4f'\ 47 | b'\x4c\x4e\x4b\x4e\x4a\x4f\x48\x50\x47\x53\x46\x56\x46\x59\x47'\ 48 | b'\x5a\x49\x5a\x4b\x59\x4d\x57\x4f\x54\x51\x50\x53\x4d\x55\x4b'\ 49 | b'\x57\x49\x5b\x20\x52\x56\x46\x58\x47\x59\x49\x59\x4b\x58\x4d'\ 50 | b'\x56\x4f\x50\x53\x20\x52\x4a\x59\x4b\x58\x4d\x58\x52\x5a\x55'\ 51 | b'\x5a\x57\x59\x58\x57\x20\x52\x4d\x58\x52\x5b\x55\x5b\x57\x5a'\ 52 | b'\x58\x57\x31\x48\x5d\x4f\x4a\x50\x4b\x4f\x4c\x4e\x4b\x4e\x4a'\ 53 | b'\x4f\x48\x50\x47\x53\x46\x56\x46\x59\x47\x5a\x49\x5a\x4b\x59'\ 54 | b'\x4d\x56\x4f\x53\x50\x20\x52\x56\x46\x58\x47\x59\x49\x59\x4b'\ 55 | b'\x58\x4d\x56\x4f\x20\x52\x51\x50\x53\x50\x56\x51\x57\x52\x58'\ 56 | b'\x54\x58\x57\x57\x59\x56\x5a\x53\x5b\x4f\x5b\x4c\x5a\x4b\x59'\ 57 | b'\x4a\x57\x4a\x56\x4b\x55\x4c\x56\x4b\x57\x20\x52\x53\x50\x55'\ 58 | b'\x51\x56\x52\x57\x54\x57\x57\x56\x59\x55\x5a\x53\x5b\x09\x48'\ 59 | b'\x5d\x58\x47\x52\x5b\x20\x52\x59\x46\x53\x5b\x20\x52\x59\x46'\ 60 | b'\x4a\x55\x5a\x55\x26\x48\x5d\x51\x46\x4c\x50\x20\x52\x51\x46'\ 61 | b'\x5b\x46\x20\x52\x51\x47\x56\x47\x5b\x46\x20\x52\x4c\x50\x4d'\ 62 | b'\x4f\x50\x4e\x53\x4e\x56\x4f\x57\x50\x58\x52\x58\x55\x57\x58'\ 63 | b'\x55\x5a\x52\x5b\x4f\x5b\x4c\x5a\x4b\x59\x4a\x57\x4a\x56\x4b'\ 64 | b'\x55\x4c\x56\x4b\x57\x20\x52\x53\x4e\x55\x4f\x56\x50\x57\x52'\ 65 | b'\x57\x55\x56\x58\x54\x5a\x52\x5b\x2d\x48\x5d\x59\x49\x58\x4a'\ 66 | b'\x59\x4b\x5a\x4a\x5a\x49\x59\x47\x57\x46\x54\x46\x51\x47\x4f'\ 67 | b'\x49\x4d\x4c\x4c\x4f\x4b\x53\x4b\x57\x4c\x59\x4d\x5a\x4f\x5b'\ 68 | b'\x52\x5b\x55\x5a\x57\x58\x58\x56\x58\x53\x57\x51\x56\x50\x54'\ 69 | b'\x4f\x51\x4f\x4f\x50\x4d\x52\x4c\x54\x20\x52\x54\x46\x52\x47'\ 70 | b'\x50\x49\x4e\x4c\x4d\x4f\x4c\x53\x4c\x58\x4d\x5a\x20\x52\x52'\ 71 | b'\x5b\x54\x5a\x56\x58\x57\x56\x57\x52\x56\x50\x1d\x48\x5d\x4e'\ 72 | b'\x46\x4c\x4c\x20\x52\x5b\x46\x5a\x49\x58\x4c\x53\x52\x51\x55'\ 73 | b'\x50\x57\x4f\x5b\x20\x52\x58\x4c\x52\x52\x50\x55\x4f\x57\x4e'\ 74 | b'\x5b\x20\x52\x4d\x49\x50\x46\x52\x46\x57\x49\x20\x52\x4e\x48'\ 75 | b'\x50\x47\x52\x47\x57\x49\x59\x49\x5a\x48\x5b\x46\x3e\x48\x5d'\ 76 | b'\x53\x46\x50\x47\x4f\x48\x4e\x4a\x4e\x4d\x4f\x4f\x51\x50\x54'\ 77 | b'\x50\x58\x4f\x59\x4e\x5a\x4c\x5a\x49\x59\x47\x56\x46\x53\x46'\ 78 | b'\x20\x52\x53\x46\x51\x47\x50\x48\x4f\x4a\x4f\x4d\x50\x4f\x51'\ 79 | b'\x50\x20\x52\x54\x50\x57\x4f\x58\x4e\x59\x4c\x59\x49\x58\x47'\ 80 | b'\x56\x46\x20\x52\x51\x50\x4d\x51\x4b\x53\x4a\x55\x4a\x58\x4b'\ 81 | b'\x5a\x4e\x5b\x52\x5b\x56\x5a\x57\x59\x58\x57\x58\x54\x57\x52'\ 82 | b'\x56\x51\x54\x50\x20\x52\x51\x50\x4e\x51\x4c\x53\x4b\x55\x4b'\ 83 | b'\x58\x4c\x5a\x4e\x5b\x20\x52\x52\x5b\x55\x5a\x56\x59\x57\x57'\ 84 | b'\x57\x53\x56\x51\x2d\x48\x5d\x59\x4d\x58\x4f\x56\x51\x54\x52'\ 85 | b'\x51\x52\x4f\x51\x4e\x50\x4d\x4e\x4d\x4b\x4e\x49\x50\x47\x53'\ 86 | b'\x46\x56\x46\x58\x47\x59\x48\x5a\x4a\x5a\x4e\x59\x52\x58\x55'\ 87 | b'\x56\x58\x54\x5a\x51\x5b\x4e\x5b\x4c\x5a\x4b\x58\x4b\x57\x4c'\ 88 | b'\x56\x4d\x57\x4c\x58\x20\x52\x4f\x51\x4e\x4f\x4e\x4b\x4f\x49'\ 89 | b'\x51\x47\x53\x46\x20\x52\x58\x47\x59\x49\x59\x4e\x58\x52\x57'\ 90 | b'\x55\x55\x58\x53\x5a\x51\x5b\x0a\x4d\x58\x53\x4d\x52\x4e\x53'\ 91 | b'\x4f\x54\x4e\x53\x4d\x20\x52\x50\x59\x4f\x5a\x50\x5b\x51\x5a'\ 92 | b'\x0d\x4d\x58\x53\x4d\x52\x4e\x53\x4f\x54\x4e\x53\x4d\x20\x52'\ 93 | b'\x50\x5b\x4f\x5a\x50\x59\x51\x5a\x51\x5b\x50\x5d\x4e\x5f\x03'\ 94 | b'\x46\x5e\x5a\x49\x4a\x52\x5a\x5b\x05\x45\x5f\x49\x4f\x5b\x4f'\ 95 | b'\x20\x52\x49\x55\x5b\x55\x03\x46\x5e\x4a\x49\x5a\x52\x4a\x5b'\ 96 | b'\x21\x48\x5d\x4f\x4a\x50\x4b\x4f\x4c\x4e\x4b\x4e\x4a\x4f\x48'\ 97 | b'\x50\x47\x53\x46\x57\x46\x5a\x47\x5b\x49\x5b\x4b\x5a\x4d\x59'\ 98 | b'\x4e\x53\x50\x51\x51\x51\x53\x52\x54\x54\x54\x20\x52\x57\x46'\ 99 | b'\x59\x47\x5a\x49\x5a\x4b\x59\x4d\x58\x4e\x56\x4f\x20\x52\x50'\ 100 | b'\x59\x4f\x5a\x50\x5b\x51\x5a\x50\x59\x37\x45\x60\x57\x4e\x56'\ 101 | b'\x4c\x54\x4b\x51\x4b\x4f\x4c\x4e\x4d\x4d\x50\x4d\x53\x4e\x55'\ 102 | b'\x50\x56\x53\x56\x55\x55\x56\x53\x20\x52\x51\x4b\x4f\x4d\x4e'\ 103 | b'\x50\x4e\x53\x4f\x55\x50\x56\x20\x52\x57\x4b\x56\x53\x56\x55'\ 104 | b'\x58\x56\x5a\x56\x5c\x54\x5d\x51\x5d\x4f\x5c\x4c\x5b\x4a\x59'\ 105 | b'\x48\x57\x47\x54\x46\x51\x46\x4e\x47\x4c\x48\x4a\x4a\x49\x4c'\ 106 | b'\x48\x4f\x48\x52\x49\x55\x4a\x57\x4c\x59\x4e\x5a\x51\x5b\x54'\ 107 | b'\x5b\x57\x5a\x59\x59\x5a\x58\x20\x52\x58\x4b\x57\x53\x57\x55'\ 108 | b'\x58\x56\x11\x48\x5c\x55\x46\x48\x5b\x20\x52\x55\x46\x56\x5b'\ 109 | b'\x20\x52\x54\x48\x55\x5b\x20\x52\x4c\x55\x55\x55\x20\x52\x46'\ 110 | b'\x5b\x4c\x5b\x20\x52\x52\x5b\x58\x5b\x28\x46\x5e\x4f\x46\x49'\ 111 | b'\x5b\x20\x52\x50\x46\x4a\x5b\x20\x52\x4c\x46\x57\x46\x5a\x47'\ 112 | b'\x5b\x49\x5b\x4b\x5a\x4e\x59\x4f\x56\x50\x20\x52\x57\x46\x59'\ 113 | b'\x47\x5a\x49\x5a\x4b\x59\x4e\x58\x4f\x56\x50\x20\x52\x4d\x50'\ 114 | b'\x56\x50\x58\x51\x59\x53\x59\x55\x58\x58\x56\x5a\x52\x5b\x46'\ 115 | b'\x5b\x20\x52\x56\x50\x57\x51\x58\x53\x58\x55\x57\x58\x55\x5a'\ 116 | b'\x52\x5b\x21\x48\x5d\x5a\x48\x5b\x48\x5c\x46\x5b\x4c\x5b\x4a'\ 117 | b'\x5a\x48\x59\x47\x57\x46\x54\x46\x51\x47\x4f\x49\x4d\x4c\x4c'\ 118 | b'\x4f\x4b\x53\x4b\x56\x4c\x59\x4d\x5a\x50\x5b\x53\x5b\x55\x5a'\ 119 | b'\x57\x58\x58\x56\x20\x52\x54\x46\x52\x47\x50\x49\x4e\x4c\x4d'\ 120 | b'\x4f\x4c\x53\x4c\x56\x4d\x59\x4e\x5a\x50\x5b\x1d\x46\x5d\x4f'\ 121 | b'\x46\x49\x5b\x20\x52\x50\x46\x4a\x5b\x20\x52\x4c\x46\x55\x46'\ 122 | b'\x58\x47\x59\x48\x5a\x4b\x5a\x4f\x59\x53\x57\x57\x55\x59\x53'\ 123 | b'\x5a\x4f\x5b\x46\x5b\x20\x52\x55\x46\x57\x47\x58\x48\x59\x4b'\ 124 | b'\x59\x4f\x58\x53\x56\x57\x54\x59\x52\x5a\x4f\x5b\x15\x46\x5d'\ 125 | b'\x4f\x46\x49\x5b\x20\x52\x50\x46\x4a\x5b\x20\x52\x54\x4c\x52'\ 126 | b'\x54\x20\x52\x4c\x46\x5b\x46\x5a\x4c\x5a\x46\x20\x52\x4d\x50'\ 127 | b'\x53\x50\x20\x52\x46\x5b\x55\x5b\x57\x56\x54\x5b\x13\x46\x5c'\ 128 | b'\x4f\x46\x49\x5b\x20\x52\x50\x46\x4a\x5b\x20\x52\x54\x4c\x52'\ 129 | b'\x54\x20\x52\x4c\x46\x5b\x46\x5a\x4c\x5a\x46\x20\x52\x4d\x50'\ 130 | b'\x53\x50\x20\x52\x46\x5b\x4d\x5b\x29\x48\x5e\x5a\x48\x5b\x48'\ 131 | b'\x5c\x46\x5b\x4c\x5b\x4a\x5a\x48\x59\x47\x57\x46\x54\x46\x51'\ 132 | b'\x47\x4f\x49\x4d\x4c\x4c\x4f\x4b\x53\x4b\x56\x4c\x59\x4d\x5a'\ 133 | b'\x50\x5b\x52\x5b\x55\x5a\x57\x58\x59\x54\x20\x52\x54\x46\x52'\ 134 | b'\x47\x50\x49\x4e\x4c\x4d\x4f\x4c\x53\x4c\x56\x4d\x59\x4e\x5a'\ 135 | b'\x50\x5b\x20\x52\x52\x5b\x54\x5a\x56\x58\x58\x54\x20\x52\x55'\ 136 | b'\x54\x5c\x54\x1a\x45\x5f\x4e\x46\x48\x5b\x20\x52\x4f\x46\x49'\ 137 | b'\x5b\x20\x52\x5b\x46\x55\x5b\x20\x52\x5c\x46\x56\x5b\x20\x52'\ 138 | b'\x4b\x46\x52\x46\x20\x52\x58\x46\x5f\x46\x20\x52\x4c\x50\x58'\ 139 | b'\x50\x20\x52\x45\x5b\x4c\x5b\x20\x52\x52\x5b\x59\x5b\x0b\x4c'\ 140 | b'\x59\x55\x46\x4f\x5b\x20\x52\x56\x46\x50\x5b\x20\x52\x52\x46'\ 141 | b'\x59\x46\x20\x52\x4c\x5b\x53\x5b\x14\x49\x5b\x58\x46\x53\x57'\ 142 | b'\x52\x59\x51\x5a\x4f\x5b\x4d\x5b\x4b\x5a\x4a\x58\x4a\x56\x4b'\ 143 | b'\x55\x4c\x56\x4b\x57\x20\x52\x57\x46\x52\x57\x51\x59\x4f\x5b'\ 144 | b'\x20\x52\x54\x46\x5b\x46\x1a\x46\x5d\x4f\x46\x49\x5b\x20\x52'\ 145 | b'\x50\x46\x4a\x5b\x20\x52\x5d\x46\x4c\x53\x20\x52\x53\x4f\x57'\ 146 | b'\x5b\x20\x52\x52\x4f\x56\x5b\x20\x52\x4c\x46\x53\x46\x20\x52'\ 147 | b'\x59\x46\x5f\x46\x20\x52\x46\x5b\x4d\x5b\x20\x52\x53\x5b\x59'\ 148 | b'\x5b\x0d\x48\x5c\x51\x46\x4b\x5b\x20\x52\x52\x46\x4c\x5b\x20'\ 149 | b'\x52\x4e\x46\x55\x46\x20\x52\x48\x5b\x57\x5b\x59\x55\x56\x5b'\ 150 | b'\x1d\x45\x60\x4e\x46\x48\x5b\x20\x52\x4e\x46\x4f\x5b\x20\x52'\ 151 | b'\x4f\x46\x50\x59\x20\x52\x5c\x46\x4f\x5b\x20\x52\x5c\x46\x56'\ 152 | b'\x5b\x20\x52\x5d\x46\x57\x5b\x20\x52\x4b\x46\x4f\x46\x20\x52'\ 153 | b'\x5c\x46\x60\x46\x20\x52\x45\x5b\x4b\x5b\x20\x52\x53\x5b\x5a'\ 154 | b'\x5b\x14\x46\x5f\x4f\x46\x49\x5b\x20\x52\x4f\x46\x56\x58\x20'\ 155 | b'\x52\x4f\x49\x56\x5b\x20\x52\x5c\x46\x56\x5b\x20\x52\x4c\x46'\ 156 | b'\x4f\x46\x20\x52\x59\x46\x5f\x46\x20\x52\x46\x5b\x4c\x5b\x29'\ 157 | b'\x47\x5d\x53\x46\x50\x47\x4e\x49\x4c\x4c\x4b\x4f\x4a\x53\x4a'\ 158 | b'\x56\x4b\x59\x4c\x5a\x4e\x5b\x51\x5b\x54\x5a\x56\x58\x58\x55'\ 159 | b'\x59\x52\x5a\x4e\x5a\x4b\x59\x48\x58\x47\x56\x46\x53\x46\x20'\ 160 | b'\x52\x53\x46\x51\x47\x4f\x49\x4d\x4c\x4c\x4f\x4b\x53\x4b\x56'\ 161 | b'\x4c\x59\x4e\x5b\x20\x52\x51\x5b\x53\x5a\x55\x58\x57\x55\x58'\ 162 | b'\x52\x59\x4e\x59\x4b\x58\x48\x56\x46\x1a\x46\x5d\x4f\x46\x49'\ 163 | b'\x5b\x20\x52\x50\x46\x4a\x5b\x20\x52\x4c\x46\x58\x46\x5b\x47'\ 164 | b'\x5c\x49\x5c\x4b\x5b\x4e\x59\x50\x55\x51\x4d\x51\x20\x52\x58'\ 165 | b'\x46\x5a\x47\x5b\x49\x5b\x4b\x5a\x4e\x58\x50\x55\x51\x20\x52'\ 166 | b'\x46\x5b\x4d\x5b\x3c\x47\x5d\x53\x46\x50\x47\x4e\x49\x4c\x4c'\ 167 | b'\x4b\x4f\x4a\x53\x4a\x56\x4b\x59\x4c\x5a\x4e\x5b\x51\x5b\x54'\ 168 | b'\x5a\x56\x58\x58\x55\x59\x52\x5a\x4e\x5a\x4b\x59\x48\x58\x47'\ 169 | b'\x56\x46\x53\x46\x20\x52\x53\x46\x51\x47\x4f\x49\x4d\x4c\x4c'\ 170 | b'\x4f\x4b\x53\x4b\x56\x4c\x59\x4e\x5b\x20\x52\x51\x5b\x53\x5a'\ 171 | b'\x55\x58\x57\x55\x58\x52\x59\x4e\x59\x4b\x58\x48\x56\x46\x20'\ 172 | b'\x52\x4c\x59\x4c\x58\x4d\x56\x4f\x55\x50\x55\x52\x56\x53\x58'\ 173 | b'\x53\x5f\x54\x60\x56\x60\x57\x5e\x57\x5d\x20\x52\x53\x58\x54'\ 174 | b'\x5e\x55\x5f\x56\x5f\x57\x5e\x29\x46\x5e\x4f\x46\x49\x5b\x20'\ 175 | b'\x52\x50\x46\x4a\x5b\x20\x52\x4c\x46\x57\x46\x5a\x47\x5b\x49'\ 176 | b'\x5b\x4b\x5a\x4e\x59\x4f\x56\x50\x4d\x50\x20\x52\x57\x46\x59'\ 177 | b'\x47\x5a\x49\x5a\x4b\x59\x4e\x58\x4f\x56\x50\x20\x52\x52\x50'\ 178 | b'\x54\x51\x55\x52\x56\x5a\x57\x5b\x59\x5b\x5a\x59\x5a\x58\x20'\ 179 | b'\x52\x55\x52\x57\x59\x58\x5a\x59\x5a\x5a\x59\x20\x52\x46\x5b'\ 180 | b'\x4d\x5b\x22\x47\x5e\x5a\x48\x5b\x48\x5c\x46\x5b\x4c\x5b\x4a'\ 181 | b'\x5a\x48\x59\x47\x56\x46\x52\x46\x4f\x47\x4d\x49\x4d\x4b\x4e'\ 182 | b'\x4d\x4f\x4e\x56\x52\x58\x54\x20\x52\x4d\x4b\x4f\x4d\x56\x51'\ 183 | b'\x57\x52\x58\x54\x58\x57\x57\x59\x56\x5a\x53\x5b\x4f\x5b\x4c'\ 184 | b'\x5a\x4b\x59\x4a\x57\x4a\x55\x49\x5b\x4a\x59\x4b\x59\x0f\x48'\ 185 | b'\x5d\x55\x46\x4f\x5b\x20\x52\x56\x46\x50\x5b\x20\x52\x4f\x46'\ 186 | b'\x4c\x4c\x4e\x46\x5d\x46\x5c\x4c\x5c\x46\x20\x52\x4c\x5b\x53'\ 187 | b'\x5b\x18\x46\x5f\x4e\x46\x4b\x51\x4a\x55\x4a\x58\x4b\x5a\x4e'\ 188 | b'\x5b\x52\x5b\x55\x5a\x57\x58\x58\x55\x5c\x46\x20\x52\x4f\x46'\ 189 | b'\x4c\x51\x4b\x55\x4b\x58\x4c\x5a\x4e\x5b\x20\x52\x4b\x46\x52'\ 190 | b'\x46\x20\x52\x59\x46\x5f\x46\x0e\x48\x5c\x4e\x46\x4f\x5b\x20'\ 191 | b'\x52\x4f\x46\x50\x59\x20\x52\x5c\x46\x4f\x5b\x20\x52\x4c\x46'\ 192 | b'\x52\x46\x20\x52\x58\x46\x5e\x46\x17\x45\x5f\x4d\x46\x4b\x5b'\ 193 | b'\x20\x52\x4e\x46\x4c\x59\x20\x52\x55\x46\x4b\x5b\x20\x52\x55'\ 194 | b'\x46\x53\x5b\x20\x52\x56\x46\x54\x59\x20\x52\x5d\x46\x53\x5b'\ 195 | b'\x20\x52\x4a\x46\x51\x46\x20\x52\x5a\x46\x60\x46\x14\x47\x5d'\ 196 | b'\x4e\x46\x55\x5b\x20\x52\x4f\x46\x56\x5b\x20\x52\x5c\x46\x48'\ 197 | b'\x5b\x20\x52\x4c\x46\x52\x46\x20\x52\x58\x46\x5e\x46\x20\x52'\ 198 | b'\x46\x5b\x4c\x5b\x20\x52\x52\x5b\x58\x5b\x13\x48\x5d\x4e\x46'\ 199 | b'\x52\x50\x4f\x5b\x20\x52\x4f\x46\x53\x50\x50\x5b\x20\x52\x5d'\ 200 | b'\x46\x53\x50\x20\x52\x4c\x46\x52\x46\x20\x52\x59\x46\x5f\x46'\ 201 | b'\x20\x52\x4c\x5b\x53\x5b\x0f\x47\x5d\x5b\x46\x48\x5b\x20\x52'\ 202 | b'\x5c\x46\x49\x5b\x20\x52\x4f\x46\x4c\x4c\x4e\x46\x5c\x46\x20'\ 203 | b'\x52\x48\x5b\x56\x5b\x58\x55\x55\x5b\x0b\x4b\x59\x4f\x42\x4f'\ 204 | b'\x62\x20\x52\x50\x42\x50\x62\x20\x52\x4f\x42\x56\x42\x20\x52'\ 205 | b'\x4f\x62\x56\x62\x02\x4b\x59\x4b\x46\x59\x5e\x0b\x4b\x59\x54'\ 206 | b'\x42\x54\x62\x20\x52\x55\x42\x55\x62\x20\x52\x4e\x42\x55\x42'\ 207 | b'\x20\x52\x4e\x62\x55\x62\x07\x47\x5d\x4a\x54\x52\x4f\x5a\x54'\ 208 | b'\x20\x52\x4a\x54\x52\x50\x5a\x54\x02\x48\x5c\x48\x62\x5c\x62'\ 209 | b'\x06\x4c\x58\x50\x46\x55\x4c\x20\x52\x50\x46\x4f\x47\x55\x4c'\ 210 | b'\x26\x48\x5d\x58\x4d\x56\x54\x55\x58\x55\x5a\x56\x5b\x59\x5b'\ 211 | b'\x5b\x59\x5c\x57\x20\x52\x59\x4d\x57\x54\x56\x58\x56\x5a\x57'\ 212 | b'\x5b\x20\x52\x56\x54\x56\x51\x55\x4e\x53\x4d\x51\x4d\x4e\x4e'\ 213 | b'\x4c\x51\x4b\x54\x4b\x57\x4c\x59\x4d\x5a\x4f\x5b\x51\x5b\x53'\ 214 | b'\x5a\x55\x57\x56\x54\x20\x52\x51\x4d\x4f\x4e\x4d\x51\x4c\x54'\ 215 | b'\x4c\x58\x4d\x5a\x23\x48\x5b\x50\x46\x4c\x53\x4c\x56\x4d\x59'\ 216 | b'\x4e\x5a\x20\x52\x51\x46\x4d\x53\x20\x52\x4d\x53\x4e\x50\x50'\ 217 | b'\x4e\x52\x4d\x54\x4d\x56\x4e\x57\x4f\x58\x51\x58\x54\x57\x57'\ 218 | b'\x55\x5a\x52\x5b\x50\x5b\x4e\x5a\x4d\x57\x4d\x53\x20\x52\x56'\ 219 | b'\x4e\x57\x50\x57\x54\x56\x57\x54\x5a\x52\x5b\x20\x52\x4d\x46'\ 220 | b'\x51\x46\x18\x49\x5b\x57\x50\x57\x51\x58\x51\x58\x50\x57\x4e'\ 221 | b'\x55\x4d\x52\x4d\x4f\x4e\x4d\x51\x4c\x54\x4c\x57\x4d\x59\x4e'\ 222 | b'\x5a\x50\x5b\x52\x5b\x55\x5a\x57\x57\x20\x52\x52\x4d\x50\x4e'\ 223 | b'\x4e\x51\x4d\x54\x4d\x58\x4e\x5a\x29\x48\x5d\x5a\x46\x56\x54'\ 224 | b'\x55\x58\x55\x5a\x56\x5b\x59\x5b\x5b\x59\x5c\x57\x20\x52\x5b'\ 225 | b'\x46\x57\x54\x56\x58\x56\x5a\x57\x5b\x20\x52\x56\x54\x56\x51'\ 226 | b'\x55\x4e\x53\x4d\x51\x4d\x4e\x4e\x4c\x51\x4b\x54\x4b\x57\x4c'\ 227 | b'\x59\x4d\x5a\x4f\x5b\x51\x5b\x53\x5a\x55\x57\x56\x54\x20\x52'\ 228 | b'\x51\x4d\x4f\x4e\x4d\x51\x4c\x54\x4c\x58\x4d\x5a\x20\x52\x57'\ 229 | b'\x46\x5b\x46\x19\x49\x5b\x4d\x56\x51\x55\x54\x54\x57\x52\x58'\ 230 | b'\x50\x57\x4e\x55\x4d\x52\x4d\x4f\x4e\x4d\x51\x4c\x54\x4c\x57'\ 231 | b'\x4d\x59\x4e\x5a\x50\x5b\x52\x5b\x55\x5a\x57\x58\x20\x52\x52'\ 232 | b'\x4d\x50\x4e\x4e\x51\x4d\x54\x4d\x58\x4e\x5a\x22\x4b\x5a\x5a'\ 233 | b'\x47\x59\x48\x5a\x49\x5b\x48\x5b\x47\x5a\x46\x58\x46\x56\x47'\ 234 | b'\x55\x48\x54\x4a\x53\x4d\x50\x5b\x4f\x5f\x4e\x61\x20\x52\x58'\ 235 | b'\x46\x56\x48\x55\x4a\x54\x4e\x52\x57\x51\x5b\x50\x5e\x4f\x60'\ 236 | b'\x4e\x61\x4c\x62\x4a\x62\x49\x61\x49\x60\x4a\x5f\x4b\x60\x4a'\ 237 | b'\x61\x20\x52\x4f\x4d\x59\x4d\x2a\x48\x5c\x59\x4d\x55\x5b\x54'\ 238 | b'\x5e\x52\x61\x4f\x62\x4c\x62\x4a\x61\x49\x60\x49\x5f\x4a\x5e'\ 239 | b'\x4b\x5f\x4a\x60\x20\x52\x58\x4d\x54\x5b\x53\x5e\x51\x61\x4f'\ 240 | b'\x62\x20\x52\x56\x54\x56\x51\x55\x4e\x53\x4d\x51\x4d\x4e\x4e'\ 241 | b'\x4c\x51\x4b\x54\x4b\x57\x4c\x59\x4d\x5a\x4f\x5b\x51\x5b\x53'\ 242 | b'\x5a\x55\x57\x56\x54\x20\x52\x51\x4d\x4f\x4e\x4d\x51\x4c\x54'\ 243 | b'\x4c\x58\x4d\x5a\x1e\x48\x5d\x50\x46\x4a\x5b\x20\x52\x51\x46'\ 244 | b'\x4b\x5b\x20\x52\x4d\x54\x4f\x50\x51\x4e\x53\x4d\x55\x4d\x57'\ 245 | b'\x4e\x58\x4f\x58\x51\x56\x57\x56\x5a\x57\x5b\x20\x52\x55\x4d'\ 246 | b'\x57\x4f\x57\x51\x55\x57\x55\x5a\x56\x5b\x59\x5b\x5b\x59\x5c'\ 247 | b'\x57\x20\x52\x4d\x46\x51\x46\x19\x4c\x59\x55\x46\x54\x47\x55'\ 248 | b'\x48\x56\x47\x55\x46\x20\x52\x4d\x51\x4e\x4f\x50\x4d\x53\x4d'\ 249 | b'\x54\x4e\x54\x51\x52\x57\x52\x5a\x53\x5b\x20\x52\x52\x4d\x53'\ 250 | b'\x4e\x53\x51\x51\x57\x51\x5a\x52\x5b\x55\x5b\x57\x59\x58\x57'\ 251 | b'\x1f\x4c\x59\x56\x46\x55\x47\x56\x48\x57\x47\x56\x46\x20\x52'\ 252 | b'\x4e\x51\x4f\x4f\x51\x4d\x54\x4d\x55\x4e\x55\x51\x52\x5b\x51'\ 253 | b'\x5e\x50\x60\x4f\x61\x4d\x62\x4b\x62\x4a\x61\x4a\x60\x4b\x5f'\ 254 | b'\x4c\x60\x4b\x61\x20\x52\x53\x4d\x54\x4e\x54\x51\x51\x5b\x50'\ 255 | b'\x5e\x4f\x60\x4d\x62\x21\x48\x5c\x50\x46\x4a\x5b\x20\x52\x51'\ 256 | b'\x46\x4b\x5b\x20\x52\x58\x4e\x57\x4f\x58\x50\x59\x4f\x59\x4e'\ 257 | b'\x58\x4d\x57\x4d\x55\x4e\x51\x52\x4f\x53\x4d\x53\x20\x52\x4f'\ 258 | b'\x53\x51\x54\x53\x5a\x54\x5b\x20\x52\x4f\x53\x50\x54\x52\x5a'\ 259 | b'\x53\x5b\x55\x5b\x57\x5a\x59\x57\x20\x52\x4d\x46\x51\x46\x11'\ 260 | b'\x4d\x59\x55\x46\x51\x54\x50\x58\x50\x5a\x51\x5b\x54\x5b\x56'\ 261 | b'\x59\x57\x57\x20\x52\x56\x46\x52\x54\x51\x58\x51\x5a\x52\x5b'\ 262 | b'\x20\x52\x52\x46\x56\x46\x33\x41\x62\x42\x51\x43\x4f\x45\x4d'\ 263 | b'\x48\x4d\x49\x4e\x49\x50\x48\x54\x46\x5b\x20\x52\x47\x4d\x48'\ 264 | b'\x4e\x48\x50\x47\x54\x45\x5b\x20\x52\x48\x54\x4a\x50\x4c\x4e'\ 265 | b'\x4e\x4d\x50\x4d\x52\x4e\x53\x4f\x53\x51\x50\x5b\x20\x52\x50'\ 266 | b'\x4d\x52\x4f\x52\x51\x4f\x5b\x20\x52\x52\x54\x54\x50\x56\x4e'\ 267 | b'\x58\x4d\x5a\x4d\x5c\x4e\x5d\x4f\x5d\x51\x5b\x57\x5b\x5a\x5c'\ 268 | b'\x5b\x20\x52\x5a\x4d\x5c\x4f\x5c\x51\x5a\x57\x5a\x5a\x5b\x5b'\ 269 | b'\x5e\x5b\x60\x59\x61\x57\x24\x46\x5d\x47\x51\x48\x4f\x4a\x4d'\ 270 | b'\x4d\x4d\x4e\x4e\x4e\x50\x4d\x54\x4b\x5b\x20\x52\x4c\x4d\x4d'\ 271 | b'\x4e\x4d\x50\x4c\x54\x4a\x5b\x20\x52\x4d\x54\x4f\x50\x51\x4e'\ 272 | b'\x53\x4d\x55\x4d\x57\x4e\x58\x4f\x58\x51\x56\x57\x56\x5a\x57'\ 273 | b'\x5b\x20\x52\x55\x4d\x57\x4f\x57\x51\x55\x57\x55\x5a\x56\x5b'\ 274 | b'\x59\x5b\x5b\x59\x5c\x57\x1f\x49\x5b\x52\x4d\x4f\x4e\x4d\x51'\ 275 | b'\x4c\x54\x4c\x57\x4d\x59\x4e\x5a\x50\x5b\x52\x5b\x55\x5a\x57'\ 276 | b'\x57\x58\x54\x58\x51\x57\x4f\x56\x4e\x54\x4d\x52\x4d\x20\x52'\ 277 | b'\x52\x4d\x50\x4e\x4e\x51\x4d\x54\x4d\x58\x4e\x5a\x20\x52\x52'\ 278 | b'\x5b\x54\x5a\x56\x57\x57\x54\x57\x50\x56\x4e\x29\x47\x5c\x48'\ 279 | b'\x51\x49\x4f\x4b\x4d\x4e\x4d\x4f\x4e\x4f\x50\x4e\x54\x4a\x62'\ 280 | b'\x20\x52\x4d\x4d\x4e\x4e\x4e\x50\x4d\x54\x49\x62\x20\x52\x4e'\ 281 | b'\x54\x4f\x51\x51\x4e\x53\x4d\x55\x4d\x57\x4e\x58\x4f\x59\x51'\ 282 | b'\x59\x54\x58\x57\x56\x5a\x53\x5b\x51\x5b\x4f\x5a\x4e\x57\x4e'\ 283 | b'\x54\x20\x52\x57\x4e\x58\x50\x58\x54\x57\x57\x55\x5a\x53\x5b'\ 284 | b'\x20\x52\x46\x62\x4d\x62\x20\x48\x5c\x58\x4d\x52\x62\x20\x52'\ 285 | b'\x59\x4d\x53\x62\x20\x52\x56\x54\x56\x51\x55\x4e\x53\x4d\x51'\ 286 | b'\x4d\x4e\x4e\x4c\x51\x4b\x54\x4b\x57\x4c\x59\x4d\x5a\x4f\x5b'\ 287 | b'\x51\x5b\x53\x5a\x55\x57\x56\x54\x20\x52\x51\x4d\x4f\x4e\x4d'\ 288 | b'\x51\x4c\x54\x4c\x58\x4d\x5a\x20\x52\x4f\x62\x56\x62\x19\x49'\ 289 | b'\x5a\x4a\x51\x4b\x4f\x4d\x4d\x50\x4d\x51\x4e\x51\x50\x50\x54'\ 290 | b'\x4e\x5b\x20\x52\x4f\x4d\x50\x4e\x50\x50\x4f\x54\x4d\x5b\x20'\ 291 | b'\x52\x50\x54\x52\x50\x54\x4e\x56\x4d\x58\x4d\x59\x4e\x59\x4f'\ 292 | b'\x58\x50\x57\x4f\x58\x4e\x1b\x4a\x5b\x58\x4f\x58\x50\x59\x50'\ 293 | b'\x59\x4f\x58\x4e\x55\x4d\x52\x4d\x4f\x4e\x4e\x4f\x4e\x51\x4f'\ 294 | b'\x52\x56\x56\x57\x57\x20\x52\x4e\x50\x4f\x51\x56\x55\x57\x56'\ 295 | b'\x57\x59\x56\x5a\x53\x5b\x50\x5b\x4d\x5a\x4c\x59\x4c\x58\x4d'\ 296 | b'\x58\x4d\x59\x11\x4b\x59\x54\x46\x50\x54\x4f\x58\x4f\x5a\x50'\ 297 | b'\x5b\x53\x5b\x55\x59\x56\x57\x20\x52\x55\x46\x51\x54\x50\x58'\ 298 | b'\x50\x5a\x51\x5b\x20\x52\x4e\x4d\x57\x4d\x24\x46\x5d\x47\x51'\ 299 | b'\x48\x4f\x4a\x4d\x4d\x4d\x4e\x4e\x4e\x51\x4c\x57\x4c\x59\x4e'\ 300 | b'\x5b\x20\x52\x4c\x4d\x4d\x4e\x4d\x51\x4b\x57\x4b\x59\x4c\x5a'\ 301 | b'\x4e\x5b\x50\x5b\x52\x5a\x54\x58\x56\x54\x20\x52\x58\x4d\x56'\ 302 | b'\x54\x55\x58\x55\x5a\x56\x5b\x59\x5b\x5b\x59\x5c\x57\x20\x52'\ 303 | b'\x59\x4d\x57\x54\x56\x58\x56\x5a\x57\x5b\x19\x48\x5c\x49\x51'\ 304 | b'\x4a\x4f\x4c\x4d\x4f\x4d\x50\x4e\x50\x51\x4e\x57\x4e\x59\x50'\ 305 | b'\x5b\x20\x52\x4e\x4d\x4f\x4e\x4f\x51\x4d\x57\x4d\x59\x4e\x5a'\ 306 | b'\x50\x5b\x51\x5b\x54\x5a\x56\x58\x58\x55\x59\x51\x59\x4d\x58'\ 307 | b'\x4d\x59\x4f\x28\x43\x60\x44\x51\x45\x4f\x47\x4d\x4a\x4d\x4b'\ 308 | b'\x4e\x4b\x51\x49\x57\x49\x59\x4b\x5b\x20\x52\x49\x4d\x4a\x4e'\ 309 | b'\x4a\x51\x48\x57\x48\x59\x49\x5a\x4b\x5b\x4d\x5b\x4f\x5a\x51'\ 310 | b'\x58\x52\x56\x20\x52\x54\x4d\x52\x56\x52\x59\x53\x5a\x55\x5b'\ 311 | b'\x57\x5b\x59\x5a\x5b\x58\x5c\x56\x5d\x52\x5d\x4d\x5c\x4d\x5d'\ 312 | b'\x4f\x20\x52\x55\x4d\x53\x56\x53\x59\x55\x5b\x29\x48\x5c\x4b'\ 313 | b'\x51\x4d\x4e\x4f\x4d\x52\x4d\x53\x4f\x53\x52\x20\x52\x51\x4d'\ 314 | b'\x52\x4f\x52\x52\x51\x56\x50\x58\x4e\x5a\x4c\x5b\x4b\x5b\x4a'\ 315 | b'\x5a\x4a\x59\x4b\x58\x4c\x59\x4b\x5a\x20\x52\x51\x56\x51\x59'\ 316 | b'\x52\x5b\x55\x5b\x57\x5a\x59\x57\x20\x52\x59\x4e\x58\x4f\x59'\ 317 | b'\x50\x5a\x4f\x5a\x4e\x59\x4d\x58\x4d\x56\x4e\x54\x50\x53\x52'\ 318 | b'\x52\x56\x52\x59\x53\x5b\x28\x47\x5c\x48\x51\x49\x4f\x4b\x4d'\ 319 | b'\x4e\x4d\x4f\x4e\x4f\x51\x4d\x57\x4d\x59\x4f\x5b\x20\x52\x4d'\ 320 | b'\x4d\x4e\x4e\x4e\x51\x4c\x57\x4c\x59\x4d\x5a\x4f\x5b\x51\x5b'\ 321 | b'\x53\x5a\x55\x58\x57\x54\x20\x52\x5a\x4d\x56\x5b\x55\x5e\x53'\ 322 | b'\x61\x50\x62\x4d\x62\x4b\x61\x4a\x60\x4a\x5f\x4b\x5e\x4c\x5f'\ 323 | b'\x4b\x60\x20\x52\x59\x4d\x55\x5b\x54\x5e\x52\x61\x50\x62\x1e'\ 324 | b'\x48\x5c\x59\x4d\x58\x4f\x56\x51\x4e\x57\x4c\x59\x4b\x5b\x20'\ 325 | b'\x52\x4c\x51\x4d\x4f\x4f\x4d\x52\x4d\x56\x4f\x20\x52\x4d\x4f'\ 326 | b'\x4f\x4e\x52\x4e\x56\x4f\x58\x4f\x20\x52\x4c\x59\x4e\x59\x52'\ 327 | b'\x5a\x55\x5a\x57\x59\x20\x52\x4e\x59\x52\x5b\x55\x5b\x57\x59'\ 328 | b'\x58\x57\x27\x4b\x59\x54\x42\x52\x43\x51\x44\x50\x46\x50\x48'\ 329 | b'\x51\x4a\x52\x4b\x53\x4d\x53\x4f\x51\x51\x20\x52\x52\x43\x51'\ 330 | b'\x45\x51\x47\x52\x49\x53\x4a\x54\x4c\x54\x4e\x53\x50\x4f\x52'\ 331 | b'\x53\x54\x54\x56\x54\x58\x53\x5a\x52\x5b\x51\x5d\x51\x5f\x52'\ 332 | b'\x61\x20\x52\x51\x53\x53\x55\x53\x57\x52\x59\x51\x5a\x50\x5c'\ 333 | b'\x50\x5e\x51\x60\x52\x61\x54\x62\x02\x4e\x56\x52\x42\x52\x62'\ 334 | b'\x27\x4b\x59\x50\x42\x52\x43\x53\x44\x54\x46\x54\x48\x53\x4a'\ 335 | b'\x52\x4b\x51\x4d\x51\x4f\x53\x51\x20\x52\x52\x43\x53\x45\x53'\ 336 | b'\x47\x52\x49\x51\x4a\x50\x4c\x50\x4e\x51\x50\x55\x52\x51\x54'\ 337 | b'\x50\x56\x50\x58\x51\x5a\x52\x5b\x53\x5d\x53\x5f\x52\x61\x20'\ 338 | b'\x52\x53\x53\x51\x55\x51\x57\x52\x59\x53\x5a\x54\x5c\x54\x5e'\ 339 | b'\x53\x60\x52\x61\x50\x62\x17\x46\x5e\x49\x55\x49\x53\x4a\x50'\ 340 | b'\x4c\x4f\x4e\x4f\x50\x50\x54\x53\x56\x54\x58\x54\x5a\x53\x5b'\ 341 | b'\x51\x20\x52\x49\x53\x4a\x51\x4c\x50\x4e\x50\x50\x51\x54\x54'\ 342 | b'\x56\x55\x58\x55\x5a\x54\x5b\x51\x5b\x4f\x22\x4a\x5a\x4a\x46'\ 343 | b'\x4a\x5b\x4b\x5b\x4b\x46\x4c\x46\x4c\x5b\x4d\x5b\x4d\x46\x4e'\ 344 | b'\x46\x4e\x5b\x4f\x5b\x4f\x46\x50\x46\x50\x5b\x51\x5b\x51\x46'\ 345 | b'\x52\x46\x52\x5b\x53\x5b\x53\x46\x54\x46\x54\x5b\x55\x5b\x55'\ 346 | b'\x46\x56\x46\x56\x5b\x57\x5b\x57\x46\x58\x46\x58\x5b\x59\x5b'\ 347 | b'\x59\x46\x5a\x46\x5a\x5b' 348 | 349 | _index =\ 350 | b'\x00\x00\x03\x00\x26\x00\x3f\x00\x58\x00\xab\x00\xec\x00\x4f'\ 351 | b'\x01\x5c\x01\x85\x01\xae\x01\xc1\x01\xce\x01\xdf\x01\xe6\x01'\ 352 | b'\xf3\x01\xfa\x01\x4f\x02\x6e\x02\xc3\x02\x28\x03\x3d\x03\x8c'\ 353 | b'\x03\xe9\x03\x26\x04\xa5\x04\x02\x05\x19\x05\x36\x05\x3f\x05'\ 354 | b'\x4c\x05\x55\x05\x9a\x05\x0b\x06\x30\x06\x83\x06\xc8\x06\x05'\ 355 | b'\x07\x32\x07\x5b\x07\xb0\x07\xe7\x07\x00\x08\x2b\x08\x62\x08'\ 356 | b'\x7f\x08\xbc\x08\xe7\x08\x3c\x09\x73\x09\xee\x09\x43\x0a\x8a'\ 357 | b'\x0a\xab\x0a\xde\x0a\xfd\x0a\x2e\x0b\x59\x0b\x82\x0b\xa3\x0b'\ 358 | b'\xbc\x0b\xc3\x0b\xdc\x0b\xed\x0b\xf4\x0b\x03\x0c\x52\x0c\x9b'\ 359 | b'\x0c\xce\x0c\x23\x0d\x58\x0d\x9f\x0d\xf6\x0d\x35\x0e\x6a\x0e'\ 360 | b'\xab\x0e\xf0\x0e\x15\x0f\x7e\x0f\xc9\x0f\x0a\x10\x5f\x10\xa2'\ 361 | b'\x10\xd7\x10\x10\x11\x35\x11\x80\x11\xb5\x11\x08\x12\x5d\x12'\ 362 | b'\xb0\x12\xef\x12\x40\x13\x47\x13\x98\x13\xc9\x13' 363 | 364 | _mvfont = memoryview(_font) 365 | 366 | def _chr_addr(ordch): 367 | offset = 2 * (ordch - 32) 368 | return int.from_bytes(_index[offset:offset + 2], 'little') 369 | 370 | def get_ch(ordch): 371 | offset = _chr_addr(ordch if 32 <= ordch <= 127 else ord('?')) 372 | count = _font[offset] 373 | return _mvfont[offset:offset+(count+2)*2-1] 374 | 375 | 376 | -------------------------------------------------------------------------------- /workSpace/romans.py: -------------------------------------------------------------------------------- 1 | def glyphs(): 2 | return 96 3 | 4 | _font =\ 5 | b'\x00\x4a\x5a\x08\x4d\x57\x52\x46\x52\x54\x20\x52\x52\x59\x51'\ 6 | b'\x5a\x52\x5b\x53\x5a\x52\x59\x05\x4a\x5a\x4e\x46\x4e\x4d\x20'\ 7 | b'\x52\x56\x46\x56\x4d\x0b\x48\x5d\x53\x42\x4c\x62\x20\x52\x59'\ 8 | b'\x42\x52\x62\x20\x52\x4c\x4f\x5a\x4f\x20\x52\x4b\x55\x59\x55'\ 9 | b'\x1a\x48\x5c\x50\x42\x50\x5f\x20\x52\x54\x42\x54\x5f\x20\x52'\ 10 | b'\x59\x49\x57\x47\x54\x46\x50\x46\x4d\x47\x4b\x49\x4b\x4b\x4c'\ 11 | b'\x4d\x4d\x4e\x4f\x4f\x55\x51\x57\x52\x58\x53\x59\x55\x59\x58'\ 12 | b'\x57\x5a\x54\x5b\x50\x5b\x4d\x5a\x4b\x58\x1f\x46\x5e\x5b\x46'\ 13 | b'\x49\x5b\x20\x52\x4e\x46\x50\x48\x50\x4a\x4f\x4c\x4d\x4d\x4b'\ 14 | b'\x4d\x49\x4b\x49\x49\x4a\x47\x4c\x46\x4e\x46\x50\x47\x53\x48'\ 15 | b'\x56\x48\x59\x47\x5b\x46\x20\x52\x57\x54\x55\x55\x54\x57\x54'\ 16 | b'\x59\x56\x5b\x58\x5b\x5a\x5a\x5b\x58\x5b\x56\x59\x54\x57\x54'\ 17 | b'\x22\x45\x5f\x5c\x4f\x5c\x4e\x5b\x4d\x5a\x4d\x59\x4e\x58\x50'\ 18 | b'\x56\x55\x54\x58\x52\x5a\x50\x5b\x4c\x5b\x4a\x5a\x49\x59\x48'\ 19 | b'\x57\x48\x55\x49\x53\x4a\x52\x51\x4e\x52\x4d\x53\x4b\x53\x49'\ 20 | b'\x52\x47\x50\x46\x4e\x47\x4d\x49\x4d\x4b\x4e\x4e\x50\x51\x55'\ 21 | b'\x58\x57\x5a\x59\x5b\x5b\x5b\x5c\x5a\x5c\x59\x07\x4d\x57\x52'\ 22 | b'\x48\x51\x47\x52\x46\x53\x47\x53\x49\x52\x4b\x51\x4c\x0a\x4b'\ 23 | b'\x59\x56\x42\x54\x44\x52\x47\x50\x4b\x4f\x50\x4f\x54\x50\x59'\ 24 | b'\x52\x5d\x54\x60\x56\x62\x0a\x4b\x59\x4e\x42\x50\x44\x52\x47'\ 25 | b'\x54\x4b\x55\x50\x55\x54\x54\x59\x52\x5d\x50\x60\x4e\x62\x08'\ 26 | b'\x4a\x5a\x52\x4c\x52\x58\x20\x52\x4d\x4f\x57\x55\x20\x52\x57'\ 27 | b'\x4f\x4d\x55\x05\x45\x5f\x52\x49\x52\x5b\x20\x52\x49\x52\x5b'\ 28 | b'\x52\x07\x4e\x56\x53\x57\x52\x58\x51\x57\x52\x56\x53\x57\x53'\ 29 | b'\x59\x51\x5b\x02\x45\x5f\x49\x52\x5b\x52\x05\x4e\x56\x52\x56'\ 30 | b'\x51\x57\x52\x58\x53\x57\x52\x56\x02\x47\x5d\x5b\x42\x49\x62'\ 31 | b'\x11\x48\x5c\x51\x46\x4e\x47\x4c\x4a\x4b\x4f\x4b\x52\x4c\x57'\ 32 | b'\x4e\x5a\x51\x5b\x53\x5b\x56\x5a\x58\x57\x59\x52\x59\x4f\x58'\ 33 | b'\x4a\x56\x47\x53\x46\x51\x46\x04\x48\x5c\x4e\x4a\x50\x49\x53'\ 34 | b'\x46\x53\x5b\x0e\x48\x5c\x4c\x4b\x4c\x4a\x4d\x48\x4e\x47\x50'\ 35 | b'\x46\x54\x46\x56\x47\x57\x48\x58\x4a\x58\x4c\x57\x4e\x55\x51'\ 36 | b'\x4b\x5b\x59\x5b\x0f\x48\x5c\x4d\x46\x58\x46\x52\x4e\x55\x4e'\ 37 | b'\x57\x4f\x58\x50\x59\x53\x59\x55\x58\x58\x56\x5a\x53\x5b\x50'\ 38 | b'\x5b\x4d\x5a\x4c\x59\x4b\x57\x06\x48\x5c\x55\x46\x4b\x54\x5a'\ 39 | b'\x54\x20\x52\x55\x46\x55\x5b\x11\x48\x5c\x57\x46\x4d\x46\x4c'\ 40 | b'\x4f\x4d\x4e\x50\x4d\x53\x4d\x56\x4e\x58\x50\x59\x53\x59\x55'\ 41 | b'\x58\x58\x56\x5a\x53\x5b\x50\x5b\x4d\x5a\x4c\x59\x4b\x57\x17'\ 42 | b'\x48\x5c\x58\x49\x57\x47\x54\x46\x52\x46\x4f\x47\x4d\x4a\x4c'\ 43 | b'\x4f\x4c\x54\x4d\x58\x4f\x5a\x52\x5b\x53\x5b\x56\x5a\x58\x58'\ 44 | b'\x59\x55\x59\x54\x58\x51\x56\x4f\x53\x4e\x52\x4e\x4f\x4f\x4d'\ 45 | b'\x51\x4c\x54\x05\x48\x5c\x59\x46\x4f\x5b\x20\x52\x4b\x46\x59'\ 46 | b'\x46\x1d\x48\x5c\x50\x46\x4d\x47\x4c\x49\x4c\x4b\x4d\x4d\x4f'\ 47 | b'\x4e\x53\x4f\x56\x50\x58\x52\x59\x54\x59\x57\x58\x59\x57\x5a'\ 48 | b'\x54\x5b\x50\x5b\x4d\x5a\x4c\x59\x4b\x57\x4b\x54\x4c\x52\x4e'\ 49 | b'\x50\x51\x4f\x55\x4e\x57\x4d\x58\x4b\x58\x49\x57\x47\x54\x46'\ 50 | b'\x50\x46\x17\x48\x5c\x58\x4d\x57\x50\x55\x52\x52\x53\x51\x53'\ 51 | b'\x4e\x52\x4c\x50\x4b\x4d\x4b\x4c\x4c\x49\x4e\x47\x51\x46\x52'\ 52 | b'\x46\x55\x47\x57\x49\x58\x4d\x58\x52\x57\x57\x55\x5a\x52\x5b'\ 53 | b'\x50\x5b\x4d\x5a\x4c\x58\x0b\x4e\x56\x52\x4f\x51\x50\x52\x51'\ 54 | b'\x53\x50\x52\x4f\x20\x52\x52\x56\x51\x57\x52\x58\x53\x57\x52'\ 55 | b'\x56\x0d\x4e\x56\x52\x4f\x51\x50\x52\x51\x53\x50\x52\x4f\x20'\ 56 | b'\x52\x53\x57\x52\x58\x51\x57\x52\x56\x53\x57\x53\x59\x51\x5b'\ 57 | b'\x03\x46\x5e\x5a\x49\x4a\x52\x5a\x5b\x05\x45\x5f\x49\x4f\x5b'\ 58 | b'\x4f\x20\x52\x49\x55\x5b\x55\x03\x46\x5e\x4a\x49\x5a\x52\x4a'\ 59 | b'\x5b\x14\x49\x5b\x4c\x4b\x4c\x4a\x4d\x48\x4e\x47\x50\x46\x54'\ 60 | b'\x46\x56\x47\x57\x48\x58\x4a\x58\x4c\x57\x4e\x56\x4f\x52\x51'\ 61 | b'\x52\x54\x20\x52\x52\x59\x51\x5a\x52\x5b\x53\x5a\x52\x59\x37'\ 62 | b'\x45\x60\x57\x4e\x56\x4c\x54\x4b\x51\x4b\x4f\x4c\x4e\x4d\x4d'\ 63 | b'\x50\x4d\x53\x4e\x55\x50\x56\x53\x56\x55\x55\x56\x53\x20\x52'\ 64 | b'\x51\x4b\x4f\x4d\x4e\x50\x4e\x53\x4f\x55\x50\x56\x20\x52\x57'\ 65 | b'\x4b\x56\x53\x56\x55\x58\x56\x5a\x56\x5c\x54\x5d\x51\x5d\x4f'\ 66 | b'\x5c\x4c\x5b\x4a\x59\x48\x57\x47\x54\x46\x51\x46\x4e\x47\x4c'\ 67 | b'\x48\x4a\x4a\x49\x4c\x48\x4f\x48\x52\x49\x55\x4a\x57\x4c\x59'\ 68 | b'\x4e\x5a\x51\x5b\x54\x5b\x57\x5a\x59\x59\x5a\x58\x20\x52\x58'\ 69 | b'\x4b\x57\x53\x57\x55\x58\x56\x08\x49\x5b\x52\x46\x4a\x5b\x20'\ 70 | b'\x52\x52\x46\x5a\x5b\x20\x52\x4d\x54\x57\x54\x17\x47\x5c\x4b'\ 71 | b'\x46\x4b\x5b\x20\x52\x4b\x46\x54\x46\x57\x47\x58\x48\x59\x4a'\ 72 | b'\x59\x4c\x58\x4e\x57\x4f\x54\x50\x20\x52\x4b\x50\x54\x50\x57'\ 73 | b'\x51\x58\x52\x59\x54\x59\x57\x58\x59\x57\x5a\x54\x5b\x4b\x5b'\ 74 | b'\x12\x48\x5d\x5a\x4b\x59\x49\x57\x47\x55\x46\x51\x46\x4f\x47'\ 75 | b'\x4d\x49\x4c\x4b\x4b\x4e\x4b\x53\x4c\x56\x4d\x58\x4f\x5a\x51'\ 76 | b'\x5b\x55\x5b\x57\x5a\x59\x58\x5a\x56\x0f\x47\x5c\x4b\x46\x4b'\ 77 | b'\x5b\x20\x52\x4b\x46\x52\x46\x55\x47\x57\x49\x58\x4b\x59\x4e'\ 78 | b'\x59\x53\x58\x56\x57\x58\x55\x5a\x52\x5b\x4b\x5b\x0b\x48\x5b'\ 79 | b'\x4c\x46\x4c\x5b\x20\x52\x4c\x46\x59\x46\x20\x52\x4c\x50\x54'\ 80 | b'\x50\x20\x52\x4c\x5b\x59\x5b\x08\x48\x5a\x4c\x46\x4c\x5b\x20'\ 81 | b'\x52\x4c\x46\x59\x46\x20\x52\x4c\x50\x54\x50\x16\x48\x5d\x5a'\ 82 | b'\x4b\x59\x49\x57\x47\x55\x46\x51\x46\x4f\x47\x4d\x49\x4c\x4b'\ 83 | b'\x4b\x4e\x4b\x53\x4c\x56\x4d\x58\x4f\x5a\x51\x5b\x55\x5b\x57'\ 84 | b'\x5a\x59\x58\x5a\x56\x5a\x53\x20\x52\x55\x53\x5a\x53\x08\x47'\ 85 | b'\x5d\x4b\x46\x4b\x5b\x20\x52\x59\x46\x59\x5b\x20\x52\x4b\x50'\ 86 | b'\x59\x50\x02\x4e\x56\x52\x46\x52\x5b\x0a\x4a\x5a\x56\x46\x56'\ 87 | b'\x56\x55\x59\x54\x5a\x52\x5b\x50\x5b\x4e\x5a\x4d\x59\x4c\x56'\ 88 | b'\x4c\x54\x08\x47\x5c\x4b\x46\x4b\x5b\x20\x52\x59\x46\x4b\x54'\ 89 | b'\x20\x52\x50\x4f\x59\x5b\x05\x48\x59\x4c\x46\x4c\x5b\x20\x52'\ 90 | b'\x4c\x5b\x58\x5b\x0b\x46\x5e\x4a\x46\x4a\x5b\x20\x52\x4a\x46'\ 91 | b'\x52\x5b\x20\x52\x5a\x46\x52\x5b\x20\x52\x5a\x46\x5a\x5b\x08'\ 92 | b'\x47\x5d\x4b\x46\x4b\x5b\x20\x52\x4b\x46\x59\x5b\x20\x52\x59'\ 93 | b'\x46\x59\x5b\x15\x47\x5d\x50\x46\x4e\x47\x4c\x49\x4b\x4b\x4a'\ 94 | b'\x4e\x4a\x53\x4b\x56\x4c\x58\x4e\x5a\x50\x5b\x54\x5b\x56\x5a'\ 95 | b'\x58\x58\x59\x56\x5a\x53\x5a\x4e\x59\x4b\x58\x49\x56\x47\x54'\ 96 | b'\x46\x50\x46\x0d\x47\x5c\x4b\x46\x4b\x5b\x20\x52\x4b\x46\x54'\ 97 | b'\x46\x57\x47\x58\x48\x59\x4a\x59\x4d\x58\x4f\x57\x50\x54\x51'\ 98 | b'\x4b\x51\x18\x47\x5d\x50\x46\x4e\x47\x4c\x49\x4b\x4b\x4a\x4e'\ 99 | b'\x4a\x53\x4b\x56\x4c\x58\x4e\x5a\x50\x5b\x54\x5b\x56\x5a\x58'\ 100 | b'\x58\x59\x56\x5a\x53\x5a\x4e\x59\x4b\x58\x49\x56\x47\x54\x46'\ 101 | b'\x50\x46\x20\x52\x53\x57\x59\x5d\x10\x47\x5c\x4b\x46\x4b\x5b'\ 102 | b'\x20\x52\x4b\x46\x54\x46\x57\x47\x58\x48\x59\x4a\x59\x4c\x58'\ 103 | b'\x4e\x57\x4f\x54\x50\x4b\x50\x20\x52\x52\x50\x59\x5b\x14\x48'\ 104 | b'\x5c\x59\x49\x57\x47\x54\x46\x50\x46\x4d\x47\x4b\x49\x4b\x4b'\ 105 | b'\x4c\x4d\x4d\x4e\x4f\x4f\x55\x51\x57\x52\x58\x53\x59\x55\x59'\ 106 | b'\x58\x57\x5a\x54\x5b\x50\x5b\x4d\x5a\x4b\x58\x05\x4a\x5a\x52'\ 107 | b'\x46\x52\x5b\x20\x52\x4b\x46\x59\x46\x0a\x47\x5d\x4b\x46\x4b'\ 108 | b'\x55\x4c\x58\x4e\x5a\x51\x5b\x53\x5b\x56\x5a\x58\x58\x59\x55'\ 109 | b'\x59\x46\x05\x49\x5b\x4a\x46\x52\x5b\x20\x52\x5a\x46\x52\x5b'\ 110 | b'\x0b\x46\x5e\x48\x46\x4d\x5b\x20\x52\x52\x46\x4d\x5b\x20\x52'\ 111 | b'\x52\x46\x57\x5b\x20\x52\x5c\x46\x57\x5b\x05\x48\x5c\x4b\x46'\ 112 | b'\x59\x5b\x20\x52\x59\x46\x4b\x5b\x06\x49\x5b\x4a\x46\x52\x50'\ 113 | b'\x52\x5b\x20\x52\x5a\x46\x52\x50\x08\x48\x5c\x59\x46\x4b\x5b'\ 114 | b'\x20\x52\x4b\x46\x59\x46\x20\x52\x4b\x5b\x59\x5b\x0b\x4b\x59'\ 115 | b'\x4f\x42\x4f\x62\x20\x52\x50\x42\x50\x62\x20\x52\x4f\x42\x56'\ 116 | b'\x42\x20\x52\x4f\x62\x56\x62\x02\x4b\x59\x4b\x46\x59\x5e\x0b'\ 117 | b'\x4b\x59\x54\x42\x54\x62\x20\x52\x55\x42\x55\x62\x20\x52\x4e'\ 118 | b'\x42\x55\x42\x20\x52\x4e\x62\x55\x62\x05\x4a\x5a\x52\x44\x4a'\ 119 | b'\x52\x20\x52\x52\x44\x5a\x52\x02\x49\x5b\x49\x62\x5b\x62\x07'\ 120 | b'\x4e\x56\x53\x4b\x51\x4d\x51\x4f\x52\x50\x53\x4f\x52\x4e\x51'\ 121 | b'\x4f\x11\x49\x5c\x58\x4d\x58\x5b\x20\x52\x58\x50\x56\x4e\x54'\ 122 | b'\x4d\x51\x4d\x4f\x4e\x4d\x50\x4c\x53\x4c\x55\x4d\x58\x4f\x5a'\ 123 | b'\x51\x5b\x54\x5b\x56\x5a\x58\x58\x11\x48\x5b\x4c\x46\x4c\x5b'\ 124 | b'\x20\x52\x4c\x50\x4e\x4e\x50\x4d\x53\x4d\x55\x4e\x57\x50\x58'\ 125 | b'\x53\x58\x55\x57\x58\x55\x5a\x53\x5b\x50\x5b\x4e\x5a\x4c\x58'\ 126 | b'\x0e\x49\x5b\x58\x50\x56\x4e\x54\x4d\x51\x4d\x4f\x4e\x4d\x50'\ 127 | b'\x4c\x53\x4c\x55\x4d\x58\x4f\x5a\x51\x5b\x54\x5b\x56\x5a\x58'\ 128 | b'\x58\x11\x49\x5c\x58\x46\x58\x5b\x20\x52\x58\x50\x56\x4e\x54'\ 129 | b'\x4d\x51\x4d\x4f\x4e\x4d\x50\x4c\x53\x4c\x55\x4d\x58\x4f\x5a'\ 130 | b'\x51\x5b\x54\x5b\x56\x5a\x58\x58\x11\x49\x5b\x4c\x53\x58\x53'\ 131 | b'\x58\x51\x57\x4f\x56\x4e\x54\x4d\x51\x4d\x4f\x4e\x4d\x50\x4c'\ 132 | b'\x53\x4c\x55\x4d\x58\x4f\x5a\x51\x5b\x54\x5b\x56\x5a\x58\x58'\ 133 | b'\x08\x4d\x59\x57\x46\x55\x46\x53\x47\x52\x4a\x52\x5b\x20\x52'\ 134 | b'\x4f\x4d\x56\x4d\x16\x49\x5c\x58\x4d\x58\x5d\x57\x60\x56\x61'\ 135 | b'\x54\x62\x51\x62\x4f\x61\x20\x52\x58\x50\x56\x4e\x54\x4d\x51'\ 136 | b'\x4d\x4f\x4e\x4d\x50\x4c\x53\x4c\x55\x4d\x58\x4f\x5a\x51\x5b'\ 137 | b'\x54\x5b\x56\x5a\x58\x58\x0a\x49\x5c\x4d\x46\x4d\x5b\x20\x52'\ 138 | b'\x4d\x51\x50\x4e\x52\x4d\x55\x4d\x57\x4e\x58\x51\x58\x5b\x08'\ 139 | b'\x4e\x56\x51\x46\x52\x47\x53\x46\x52\x45\x51\x46\x20\x52\x52'\ 140 | b'\x4d\x52\x5b\x0b\x4d\x57\x52\x46\x53\x47\x54\x46\x53\x45\x52'\ 141 | b'\x46\x20\x52\x53\x4d\x53\x5e\x52\x61\x50\x62\x4e\x62\x08\x49'\ 142 | b'\x5a\x4d\x46\x4d\x5b\x20\x52\x57\x4d\x4d\x57\x20\x52\x51\x53'\ 143 | b'\x58\x5b\x02\x4e\x56\x52\x46\x52\x5b\x12\x43\x61\x47\x4d\x47'\ 144 | b'\x5b\x20\x52\x47\x51\x4a\x4e\x4c\x4d\x4f\x4d\x51\x4e\x52\x51'\ 145 | b'\x52\x5b\x20\x52\x52\x51\x55\x4e\x57\x4d\x5a\x4d\x5c\x4e\x5d'\ 146 | b'\x51\x5d\x5b\x0a\x49\x5c\x4d\x4d\x4d\x5b\x20\x52\x4d\x51\x50'\ 147 | b'\x4e\x52\x4d\x55\x4d\x57\x4e\x58\x51\x58\x5b\x11\x49\x5c\x51'\ 148 | b'\x4d\x4f\x4e\x4d\x50\x4c\x53\x4c\x55\x4d\x58\x4f\x5a\x51\x5b'\ 149 | b'\x54\x5b\x56\x5a\x58\x58\x59\x55\x59\x53\x58\x50\x56\x4e\x54'\ 150 | b'\x4d\x51\x4d\x11\x48\x5b\x4c\x4d\x4c\x62\x20\x52\x4c\x50\x4e'\ 151 | b'\x4e\x50\x4d\x53\x4d\x55\x4e\x57\x50\x58\x53\x58\x55\x57\x58'\ 152 | b'\x55\x5a\x53\x5b\x50\x5b\x4e\x5a\x4c\x58\x11\x49\x5c\x58\x4d'\ 153 | b'\x58\x62\x20\x52\x58\x50\x56\x4e\x54\x4d\x51\x4d\x4f\x4e\x4d'\ 154 | b'\x50\x4c\x53\x4c\x55\x4d\x58\x4f\x5a\x51\x5b\x54\x5b\x56\x5a'\ 155 | b'\x58\x58\x08\x4b\x58\x4f\x4d\x4f\x5b\x20\x52\x4f\x53\x50\x50'\ 156 | b'\x52\x4e\x54\x4d\x57\x4d\x11\x4a\x5b\x58\x50\x57\x4e\x54\x4d'\ 157 | b'\x51\x4d\x4e\x4e\x4d\x50\x4e\x52\x50\x53\x55\x54\x57\x55\x58'\ 158 | b'\x57\x58\x58\x57\x5a\x54\x5b\x51\x5b\x4e\x5a\x4d\x58\x08\x4d'\ 159 | b'\x59\x52\x46\x52\x57\x53\x5a\x55\x5b\x57\x5b\x20\x52\x4f\x4d'\ 160 | b'\x56\x4d\x0a\x49\x5c\x4d\x4d\x4d\x57\x4e\x5a\x50\x5b\x53\x5b'\ 161 | b'\x55\x5a\x58\x57\x20\x52\x58\x4d\x58\x5b\x05\x4a\x5a\x4c\x4d'\ 162 | b'\x52\x5b\x20\x52\x58\x4d\x52\x5b\x0b\x47\x5d\x4a\x4d\x4e\x5b'\ 163 | b'\x20\x52\x52\x4d\x4e\x5b\x20\x52\x52\x4d\x56\x5b\x20\x52\x5a'\ 164 | b'\x4d\x56\x5b\x05\x4a\x5b\x4d\x4d\x58\x5b\x20\x52\x58\x4d\x4d'\ 165 | b'\x5b\x09\x4a\x5a\x4c\x4d\x52\x5b\x20\x52\x58\x4d\x52\x5b\x50'\ 166 | b'\x5f\x4e\x61\x4c\x62\x4b\x62\x08\x4a\x5b\x58\x4d\x4d\x5b\x20'\ 167 | b'\x52\x4d\x4d\x58\x4d\x20\x52\x4d\x5b\x58\x5b\x27\x4b\x59\x54'\ 168 | b'\x42\x52\x43\x51\x44\x50\x46\x50\x48\x51\x4a\x52\x4b\x53\x4d'\ 169 | b'\x53\x4f\x51\x51\x20\x52\x52\x43\x51\x45\x51\x47\x52\x49\x53'\ 170 | b'\x4a\x54\x4c\x54\x4e\x53\x50\x4f\x52\x53\x54\x54\x56\x54\x58'\ 171 | b'\x53\x5a\x52\x5b\x51\x5d\x51\x5f\x52\x61\x20\x52\x51\x53\x53'\ 172 | b'\x55\x53\x57\x52\x59\x51\x5a\x50\x5c\x50\x5e\x51\x60\x52\x61'\ 173 | b'\x54\x62\x02\x4e\x56\x52\x42\x52\x62\x27\x4b\x59\x50\x42\x52'\ 174 | b'\x43\x53\x44\x54\x46\x54\x48\x53\x4a\x52\x4b\x51\x4d\x51\x4f'\ 175 | b'\x53\x51\x20\x52\x52\x43\x53\x45\x53\x47\x52\x49\x51\x4a\x50'\ 176 | b'\x4c\x50\x4e\x51\x50\x55\x52\x51\x54\x50\x56\x50\x58\x51\x5a'\ 177 | b'\x52\x5b\x53\x5d\x53\x5f\x52\x61\x20\x52\x53\x53\x51\x55\x51'\ 178 | b'\x57\x52\x59\x53\x5a\x54\x5c\x54\x5e\x53\x60\x52\x61\x50\x62'\ 179 | b'\x17\x46\x5e\x49\x55\x49\x53\x4a\x50\x4c\x4f\x4e\x4f\x50\x50'\ 180 | b'\x54\x53\x56\x54\x58\x54\x5a\x53\x5b\x51\x20\x52\x49\x53\x4a'\ 181 | b'\x51\x4c\x50\x4e\x50\x50\x51\x54\x54\x56\x55\x58\x55\x5a\x54'\ 182 | b'\x5b\x51\x5b\x4f\x22\x4a\x5a\x4a\x46\x4a\x5b\x4b\x5b\x4b\x46'\ 183 | b'\x4c\x46\x4c\x5b\x4d\x5b\x4d\x46\x4e\x46\x4e\x5b\x4f\x5b\x4f'\ 184 | b'\x46\x50\x46\x50\x5b\x51\x5b\x51\x46\x52\x46\x52\x5b\x53\x5b'\ 185 | b'\x53\x46\x54\x46\x54\x5b\x55\x5b\x55\x46\x56\x46\x56\x5b\x57'\ 186 | b'\x5b\x57\x46\x58\x46\x58\x5b\x59\x5b\x59\x46\x5a\x46\x5a\x5b'\ 187 | b'' 188 | 189 | _index =\ 190 | b'\x00\x00\x03\x00\x16\x00\x23\x00\x3c\x00\x73\x00\xb4\x00\xfb'\ 191 | b'\x00\x0c\x01\x23\x01\x3a\x01\x4d\x01\x5a\x01\x6b\x01\x72\x01'\ 192 | b'\x7f\x01\x86\x01\xab\x01\xb6\x01\xd5\x01\xf6\x01\x05\x02\x2a'\ 193 | b'\x02\x5b\x02\x68\x02\xa5\x02\xd6\x02\xef\x02\x0c\x03\x15\x03'\ 194 | b'\x22\x03\x2b\x03\x56\x03\xc7\x03\xda\x03\x0b\x04\x32\x04\x53'\ 195 | b'\x04\x6c\x04\x7f\x04\xae\x04\xc1\x04\xc8\x04\xdf\x04\xf2\x04'\ 196 | b'\xff\x04\x18\x05\x2b\x05\x58\x05\x75\x05\xa8\x05\xcb\x05\xf6'\ 197 | b'\x05\x03\x06\x1a\x06\x27\x06\x40\x06\x4d\x06\x5c\x06\x6f\x06'\ 198 | b'\x88\x06\x8f\x06\xa8\x06\xb5\x06\xbc\x06\xcd\x06\xf2\x06\x17'\ 199 | b'\x07\x36\x07\x5b\x07\x80\x07\x93\x07\xc2\x07\xd9\x07\xec\x07'\ 200 | b'\x05\x08\x18\x08\x1f\x08\x46\x08\x5d\x08\x82\x08\xa7\x08\xcc'\ 201 | b'\x08\xdf\x08\x04\x09\x17\x09\x2e\x09\x3b\x09\x54\x09\x61\x09'\ 202 | b'\x76\x09\x89\x09\xda\x09\xe1\x09\x32\x0a\x63\x0a' 203 | 204 | _mvfont = memoryview(_font) 205 | 206 | def _chr_addr(ordch): 207 | offset = 2 * (ordch - 32) 208 | return int.from_bytes(_index[offset:offset + 2], 'little') 209 | 210 | def get_ch(ordch): 211 | offset = _chr_addr(ordch if 32 <= ordch <= 127 else ord('?')) 212 | count = _font[offset] 213 | return _mvfont[offset:offset+(count+2)*2-1] 214 | 215 | 216 | -------------------------------------------------------------------------------- /workSpace/st7789py.py: -------------------------------------------------------------------------------- 1 | import time 2 | from micropython import const 3 | import ustruct as struct 4 | 5 | # commands 6 | ST77XX_NOP = const(0x00) 7 | ST77XX_SWRESET = const(0x01) 8 | ST77XX_RDDID = const(0x04) 9 | ST77XX_RDDST = const(0x09) 10 | 11 | ST77XX_SLPIN = const(0x10) 12 | ST77XX_SLPOUT = const(0x11) 13 | ST77XX_PTLON = const(0x12) 14 | ST77XX_NORON = const(0x13) 15 | 16 | ST77XX_INVOFF = const(0x20) 17 | ST77XX_INVON = const(0x21) 18 | ST77XX_DISPOFF = const(0x28) 19 | ST77XX_DISPON = const(0x29) 20 | ST77XX_CASET = const(0x2A) 21 | ST77XX_RASET = const(0x2B) 22 | ST77XX_RAMWR = const(0x2C) 23 | ST77XX_RAMRD = const(0x2E) 24 | 25 | ST77XX_PTLAR = const(0x30) 26 | ST77XX_COLMOD = const(0x3A) 27 | ST7789_MADCTL = const(0x36) 28 | 29 | ST7789_MADCTL_MY = const(0x80) 30 | ST7789_MADCTL_MX = const(0x40) 31 | ST7789_MADCTL_MV = const(0x20) 32 | ST7789_MADCTL_ML = const(0x10) 33 | ST7789_MADCTL_BGR = const(0x08) 34 | ST7789_MADCTL_MH = const(0x04) 35 | ST7789_MADCTL_RGB = const(0x00) 36 | 37 | ST7789_RDID1 = const(0xDA) 38 | ST7789_RDID2 = const(0xDB) 39 | ST7789_RDID3 = const(0xDC) 40 | ST7789_RDID4 = const(0xDD) 41 | 42 | ColorMode_65K = const(0x50) 43 | ColorMode_262K = const(0x60) 44 | ColorMode_12bit = const(0x03) 45 | ColorMode_16bit = const(0x05) 46 | ColorMode_18bit = const(0x06) 47 | ColorMode_16M = const(0x07) 48 | 49 | # Color definitions 50 | BLACK = const(0x0000) 51 | BLUE = const(0x001F) 52 | RED = const(0xF800) 53 | GREEN = const(0x07E0) 54 | CYAN = const(0x07FF) 55 | MAGENTA = const(0xF81F) 56 | YELLOW = const(0xFFE0) 57 | WHITE = const(0xFFFF) 58 | 59 | _ENCODE_PIXEL = ">H" 60 | _ENCODE_POS = ">HH" 61 | _DECODE_PIXEL = ">BBB" 62 | 63 | _BUFFER_SIZE = const(256) 64 | 65 | 66 | def delay_ms(ms): 67 | time.sleep_ms(ms) 68 | 69 | 70 | def color565(r, g=0, b=0): 71 | """Convert red, green and blue values (0-255) into a 16-bit 565 encoding. As 72 | a convenience this is also available in the parent adafruit_rgb_display 73 | package namespace.""" 74 | try: 75 | r, g, b = r # see if the first var is a tuple/list 76 | except TypeError: 77 | pass 78 | return (r & 0xf8) << 8 | (g & 0xfc) << 3 | b >> 3 79 | 80 | 81 | class ST77xx: 82 | def __init__(self, spi, width, height, reset, dc, cs=None, backlight=None, 83 | xstart=-1, ystart=-1): 84 | """ 85 | display = st7789.ST7789( 86 | SPI(1, baudrate=40000000, phase=0, polarity=1), 87 | 240, 240, 88 | reset=machine.Pin(5, machine.Pin.OUT), 89 | dc=machine.Pin(2, machine.Pin.OUT), 90 | ) 91 | 92 | """ 93 | self.width = width 94 | self.height = height 95 | self.spi = spi 96 | if spi is None: 97 | import machine 98 | #self.spi = machine.SPI(1, baudrate=10000000, phase=0, polarity=1) 99 | self.spi = machine.SPI(1, baudrate=10000000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))#HSPI 100 | self.reset = reset 101 | self.dc = dc 102 | self.cs = cs 103 | self.backlight = backlight 104 | #self.font=font.FONT6_8() 105 | if xstart >= 0 and ystart >= 0: 106 | self.xstart = xstart 107 | self.ystart = ystart 108 | elif (self.width, self.height) == (240, 240): 109 | self.xstart = 0 110 | self.ystart = 0 111 | elif (self.width, self.height) == (135, 240): 112 | self.xstart = 52 113 | self.ystart = 40 114 | else: 115 | raise ValueError( 116 | "Unsupported display. Only 240x240 and 135x240 are supported " 117 | "without xstart and ystart provided" 118 | ) 119 | 120 | def dc_low(self): 121 | self.dc.off() 122 | 123 | def dc_high(self): 124 | self.dc.on() 125 | 126 | def reset_low(self): 127 | if self.reset: 128 | self.reset.off() 129 | 130 | def reset_high(self): 131 | if self.reset: 132 | self.reset.on() 133 | 134 | def cs_low(self): 135 | if self.cs: 136 | self.cs.off() 137 | 138 | def cs_high(self): 139 | if self.cs: 140 | self.cs.on() 141 | 142 | def write(self, command=None, data=None): 143 | """SPI write to the device: commands and data""" 144 | self.cs_low() 145 | if command is not None: 146 | self.dc_low() 147 | self.spi.write(bytes([command])) 148 | if data is not None: 149 | self.dc_high() 150 | self.spi.write(data) 151 | self.cs_high() 152 | 153 | def hard_reset(self): 154 | self.cs_low() 155 | self.reset_high() 156 | delay_ms(50) 157 | self.reset_low() 158 | delay_ms(50) 159 | self.reset_high() 160 | delay_ms(150) 161 | self.cs_high() 162 | 163 | def soft_reset(self): 164 | self.write(ST77XX_SWRESET) 165 | delay_ms(150) 166 | 167 | def sleep_mode(self, value): 168 | if value: 169 | self.write(ST77XX_SLPIN) 170 | else: 171 | self.write(ST77XX_SLPOUT) 172 | 173 | def inversion_mode(self, value): 174 | if value: 175 | self.write(ST77XX_INVON) 176 | else: 177 | self.write(ST77XX_INVOFF) 178 | 179 | def _set_color_mode(self, mode): 180 | self.write(ST77XX_COLMOD, bytes([mode & 0x77])) 181 | 182 | def init(self, *args, **kwargs): 183 | self.hard_reset() 184 | self.soft_reset() 185 | self.sleep_mode(False) 186 | 187 | def _set_mem_access_mode(self, rotation, vert_mirror, horz_mirror, is_bgr): 188 | rotation &= 7 189 | value = { 190 | 0: 0, 191 | 1: ST7789_MADCTL_MX, 192 | 2: ST7789_MADCTL_MY, 193 | 3: ST7789_MADCTL_MX | ST7789_MADCTL_MY, 194 | 4: ST7789_MADCTL_MV, 195 | 5: ST7789_MADCTL_MV | ST7789_MADCTL_MX, 196 | 6: ST7789_MADCTL_MV | ST7789_MADCTL_MY, 197 | 7: ST7789_MADCTL_MV | ST7789_MADCTL_MX | ST7789_MADCTL_MY, 198 | }[rotation] 199 | 200 | if vert_mirror: 201 | value = ST7789_MADCTL_ML 202 | elif horz_mirror: 203 | value = ST7789_MADCTL_MH 204 | 205 | if is_bgr: 206 | value |= ST7789_MADCTL_BGR 207 | self.write(ST7789_MADCTL, bytes([value])) 208 | 209 | def _encode_pos(self, x, y): 210 | """Encode a postion into bytes.""" 211 | return struct.pack(_ENCODE_POS, x, y) 212 | 213 | def _encode_pixel(self, color): 214 | """Encode a pixel color into bytes.""" 215 | return struct.pack(_ENCODE_PIXEL, color) 216 | 217 | def _set_columns(self, start, end): 218 | if start > end or end >= self.width: 219 | return 220 | start += self.xstart 221 | end += self.xstart 222 | self.write(ST77XX_CASET, self._encode_pos(start, end)) 223 | 224 | def _set_rows(self, start, end): 225 | if start > end or end >= self.height: 226 | return 227 | start += self.ystart 228 | end += self.ystart 229 | self.write(ST77XX_RASET, self._encode_pos(start, end)) 230 | 231 | def set_window(self, x0, y0, x1, y1): 232 | self._set_columns(x0, x1) 233 | self._set_rows(y0, y1) 234 | self.write(ST77XX_RAMWR) 235 | 236 | def vline(self, x, y, length, color): 237 | self.fill_rect(x, y, 1, length, color) 238 | 239 | def hline(self, x, y, length, color): 240 | self.fill_rect(x, y, length, 1, color) 241 | 242 | def pixel(self, x, y, color): 243 | self.set_window(x, y, x, y) 244 | self.write(None, self._encode_pixel(color)) 245 | 246 | def blit_buffer(self, buffer, x, y, width, height): 247 | self.set_window(x, y, x + width - 1, y + height - 1) 248 | self.write(None, buffer) 249 | 250 | def rect(self, x, y, w, h, color): 251 | self.hline(x, y, w, color) 252 | self.vline(x, y, h, color) 253 | self.vline(x + w - 1, y, h, color) 254 | self.hline(x, y + h - 1, w, color) 255 | 256 | def fill_rect(self, x, y, width, height, color): 257 | self.set_window(x, y, x + width - 1, y + height - 1) 258 | chunks, rest = divmod(width * height, _BUFFER_SIZE) 259 | pixel = self._encode_pixel(color) 260 | self.dc_high() 261 | if chunks: 262 | data = pixel * _BUFFER_SIZE 263 | for _ in range(chunks): 264 | self.write(None, data) 265 | if rest: 266 | self.write(None, pixel * rest) 267 | 268 | def fill(self, color): 269 | self.fill_rect(0, 0, self.width, self.height, color) 270 | 271 | def line(self, x0, y0, x1, y1, color): 272 | # Line drawing function. Will draw a single pixel wide line starting at 273 | # x0, y0 and ending at x1, y1. 274 | steep = abs(y1 - y0) > abs(x1 - x0) 275 | if steep: 276 | x0, y0 = y0, x0 277 | x1, y1 = y1, x1 278 | if x0 > x1: 279 | x0, x1 = x1, x0 280 | y0, y1 = y1, y0 281 | dx = x1 - x0 282 | dy = abs(y1 - y0) 283 | err = dx // 2 284 | if y0 < y1: 285 | ystep = 1 286 | else: 287 | ystep = -1 288 | while x0 <= x1: 289 | if steep: 290 | self.pixel(y0, x0, color) 291 | else: 292 | self.pixel(x0, y0, color) 293 | err -= dy 294 | if err < 0: 295 | y0 += ystep 296 | err += dx 297 | x0 += 1 298 | 299 | def text(self, font, message, row=32, column=0, color=WHITE): 300 | ''' 301 | Write `text` on `display` starting on `row` stating in `column` using 302 | ` font` in `color` 303 | 304 | Args: 305 | display: The display device to write on 306 | font: The pyfont module to use 307 | message: The message to write 308 | row: Row to start at, defaults to 32 309 | column: Column to start at, defaults to 0 310 | color: The color to write in 311 | ''' 312 | from_x = to_x = pos_x = column 313 | from_y = to_y = pos_y = row 314 | 315 | for char in [ord(char) for char in message]: 316 | penup = True 317 | if 32 <= char <= 127: 318 | data = bytearray(font.get_ch(char)) 319 | length = data[0] 320 | left = data[1] - 0x52 321 | right = data[2] - 0x52 322 | width = right - left 323 | 324 | for vect in range (3, len(data), 2): 325 | vector_x = data[vect] - 0x52 326 | vector_y = data[vect+1] - 0x52 327 | 328 | if vector_x == -50: 329 | penup = True 330 | continue 331 | 332 | if not vect or penup: 333 | from_x = pos_x + vector_x - left 334 | from_y = pos_y + vector_y 335 | else: 336 | to_x = pos_x + vector_x - left 337 | to_y = pos_y + vector_y 338 | 339 | self.line(from_x, from_y, to_x, to_y, color) 340 | 341 | from_x = to_x 342 | from_y = to_y 343 | penup = False 344 | 345 | pos_x += width 346 | 347 | class ST7789(ST77xx): 348 | def init(self, *, color_mode=ColorMode_65K | ColorMode_16bit): 349 | super().init() 350 | self._set_color_mode(color_mode) 351 | delay_ms(50) 352 | self._set_mem_access_mode(4, True, True, False) 353 | self.inversion_mode(True) 354 | delay_ms(10) 355 | self.write(ST77XX_NORON) 356 | delay_ms(10) 357 | self.fill(0) 358 | self.write(ST77XX_DISPON) 359 | delay_ms(500) 360 | 361 | 362 | 363 | --------------------------------------------------------------------------------