├── LICENSE ├── README.md ├── SSD_13XX.cpp ├── SSD_13XX.h ├── _display ├── SSD_1331_96x64.h ├── SSD_1331_REDPCB.h ├── SSD_1332_96x64.h ├── SSD_1351_128x128.h └── SSD_1351_128x96.h ├── _fonts ├── Terminal_9.c ├── akasha_cap.c ├── akashi20.c ├── arial10.c ├── arial20.c ├── defaultFont.c ├── mono_mid.c ├── msShell14.c ├── nullfont.c ├── orbitron14.c ├── square_small.c ├── titlingCaps.c └── unborn_small.c ├── _icons ├── mixer1.c ├── spkOff.c ├── spkOn.c ├── wifi.c └── world.c ├── _images ├── eye │ ├── eye0.c │ ├── eye1.c │ ├── eye10.c │ ├── eye11.c │ ├── eye12.c │ ├── eye13.c │ ├── eye14.c │ ├── eye15.c │ ├── eye16.c │ ├── eye17.c │ ├── eye2.c │ ├── eye3.c │ ├── eye4.c │ ├── eye5.c │ ├── eye6.c │ ├── eye7.c │ ├── eye8.c │ ├── eye9.c │ └── eye93.c ├── hands.c ├── machine.c ├── nature.c ├── rad1.c ├── redb.c ├── skull.c ├── sw1.c ├── wifi2.c ├── wifi2s.c └── wifi2sr.c ├── _includes ├── SSD_1331_registers.h ├── SSD_1332_registers.h ├── SSD_1351_registers.h ├── _common_16bit_colors.h ├── _cpuCommons.h ├── sumotoy_fontDescription.h ├── sumotoy_iconDescription.h └── sumotoy_imageDescription.h ├── _settings └── SSD_13XX_settings.h ├── _utility └── for_LCD_Font_Converter │ ├── ConverterPreset │ ├── sumotoy_font.xml │ ├── sumotoy_icon.xml │ └── sumotoy_image.xml │ ├── FontFiles │ ├── Terminal_9.xml │ ├── akasha_cap.xml │ ├── akashi20.xml │ ├── arial10.xml │ ├── arial20.xml │ ├── arial_x2.rar │ ├── defaultFont.xml │ ├── mono_mid.xml │ ├── msShell14.xml │ ├── orbitron14.xml │ ├── square_small.xml │ ├── titlingCaps.xml │ └── unborn_small.xml │ ├── font_range.txt │ ├── sumotoy_font_2.4.tmpl │ ├── sumotoy_icon_1.3.tmpl │ └── sumotoy_picture_1.3.tmpl ├── examples ├── Benchmark │ └── Benchmark.ino ├── Benchmarks_Alternative │ ├── Benchmarks_Alternative.ino │ └── tests.ino ├── Clock_example │ └── Clock_example.ino ├── ColorMood_example │ └── ColorMood_example.ino ├── Solid3D_example │ └── Solid3D_example.ino ├── _ESP8266 │ ├── Benchmark │ │ └── Benchmark.ino │ ├── WiFi_scan │ │ └── WiFi_scan.ino │ ├── basicSetup │ │ └── basicSetup.ino │ ├── drawLineAngle_example │ │ └── drawLineAngle_example.ino │ └── externalFonts │ │ └── externalFonts.ino ├── avr_benchmark │ └── avr_benchmark.ino ├── basicSetup │ └── basicSetup.ino ├── benchmark_version2.rar ├── bigtest │ └── bigtest.ino ├── bubbles │ └── bubbles.ino ├── char_remap_example │ └── char_remap_example.ino ├── drawLineAngle_example │ └── drawLineAngle_example.ino ├── externalFonts │ └── externalFonts.ino ├── graphictest │ └── graphictest.ino ├── icon_inverse │ └── icon_inverse.ino ├── icon_simple │ └── icon_simple.ino ├── icon_simple2 │ └── icon_simple2.ino ├── image_background │ ├── Debug │ │ ├── board.buildinfo │ │ ├── image_background.ino.elf │ │ └── image_background.ino.hex │ ├── __vm │ │ ├── .image_background.vsarduino.h │ │ ├── Compile.vmps.xml │ │ ├── Configuration.Debug.vmps.xml │ │ └── Upload.vmps.xml │ ├── image_background.ino │ ├── image_background.vcxproj │ └── image_background.vcxproj.filters ├── image_eyeAnimation │ └── image_eyeAnimation.ino ├── image_simple │ └── image_simple.ino ├── ringMeterExample │ └── ringMeterExample.ino ├── roundGaugeWithBallistic │ └── roundGaugeWithBallistic.ino └── textCentering │ └── textCentering.ino ├── keywords.txt ├── library.json └── library.properties /README.md: -------------------------------------------------------------------------------- 1 | # SSD_13XX 2 | A very fast and full featured driver for Solomon Systech SSD1331, SSD1332, SSD1322 and SSD1351 drivers designed mainly for Oled's compatible with Teensy's and many other MCU's. 3 | I have other 2 libraries here in github but have some issues and are quite old, this will replace both.
4 | 5 | Current Version:
6 | - 1.0r2: SSD1331/SSD1332/SSD1351 tested only with various Teensy's and ESP8266 (Have to set SPI at 79.999.999!). If not work with other CPU please report only, I NEVER tested the code with other CPU's so I expect this, but remember that is a preview and things gonna change soon. 7 | 8 | Driver description (what I should choose?):
9 | * SSD1331 is a full featured driver for 96x64 oled with a lot of useful registers and an hardware accellerated standalone scroll that I never seen in other drivers. This controller is currently supported.
10 | * SSD1332 is the 'low cost' version of SSD1331, much less features, less fast (but use some Hardware Accellerated primitives), no scrolling. This controller is currently supported.
11 | * SSD1322 used in some wide oled's.(in development)
12 | * SSD1351 Can drive 128x128 Oled's, doesn't have any Hardware Accellerated primitive (apart scrolling as SD1331), pretty featured. This controller is currently supported.
13 | 14 | *** 15 | 16 | SSD1331 Currently my preferred one...
17 | Uncomment in settings file: #include "../_display/SSD_1331_96x64.h" 18 | ![SSD1331](https://github.com/sumotoy/SSD_13XX/blob/docs/images/ssd1331.png)
19 | NOTE:works out of the box, no hardware configurations, very bright 20 | *** 21 | SSD1331 RED PCB 0.96" Color Oled
22 | Uncomment in settings file: #include "../_display/SSD_1331_REDPCB.h" 23 | ![SSD1331b](https://github.com/sumotoy/SSD_13XX/blob/docs/images/ssd1331b.png)
24 | NOTE:This Oled needs to be configured for SPI (jumpers on the back) and you should connect D2,D3,D4,D5,D6,D7 to GND! 25 | *** 26 | SSD1332
27 | Uncomment in settings file: #include "../_display/SSD_1332_96x64.h" 28 | ![SSD1332](https://github.com/sumotoy/SSD_13XX/blob/docs/images/ssd1332.png)
29 | NOTE:This Oled needs to be configured for SPI (jumpers on the back) and you should connect D2,D3,D4,D5,D6,D7 to GND! I will not raccomand this, red color is still orange to me. 30 | *** 31 | SSD1351 128x128
32 | Uncomment in settings file: #include "../_display/SSD_1351_128x128.h" 33 | ![SSD1332](https://github.com/sumotoy/SSD_13XX/blob/docs/images/ssd1351.png)
34 | 35 | *** 36 | 37 | How to set driver:
38 | You need to open _settings/SSD_13XX_settings.h with a text editor and uncomment the driver you want to use:
39 | Es. #include "../_display/SSD_1331_96x64.h" 40 | 41 | Driver that will never supported:
42 | - SSD_1306: This device need a completely different library since it have no internal framebuffer.
43 | 44 | *** 45 | CPU Supported:
46 | - Teensy 3.0, 3.1, 3.2, 3.4, 3.5, LC 47 | - Teensy 2.0 and variant 48 | - Any AVR 8 bit (UNO, etc.) 49 | - Arduino DUE 50 | - ESP8266 51 | - SPARK (next versions) 52 | - Several ST (next versions)
53 | 54 | Note: I currently will not support Arduino Zero, it's currently poor documented and it cost a fortune, I suggest a Teensy that is much cheaper, more featured and smaller!
55 | However, this is open source an released with GNU V3 so you can fork library and add Zero support yourself as you respect the GNU licence and leave intact any comment.
56 | 57 | *** 58 | Background:
59 | I got my first SSD_1331 on Ebay, find a library compatible at Adafruit but I was extremely disappointed about performances/features and bugs, so I decided to write a new one from scratch based on my popular TFT_ILI9163C. Since this devices are very similar I have decided to build up an unique library.
60 | I have 2 old libraries here on github, but digging inside datasheet I discover that I can get much more by rewrote almost everithing. As result I got all chip features enabled and it's probably the faster driver around, much more than adafruit and works with all features at any screen rotation by using all the time his hardware accellerated primitives
61 | Commands and features are pretty similar to TFT_9163C,TFT_7735,TFT_ILI93XX last libraries here on github, of course there's differences related to hardware (OLED don't have backlight pin, etc.) 62 | *** 63 | Features:
64 | - A display file for each oled, easy to customize. 65 | - Blazing fast, near chip hardware limits, expecially with Teensy's. 66 | - Any feature enabled for any rotation, using native hardware accellerated primitives. 67 | - Standard SPI & SPI transaction compatible, play nice with other SPI devices. 68 | - Many CPU supported. 69 | - Ultrafast Teensy's 3.0,3.1,3.2,3.4,3.5 SPI FIFO. 70 | - Fully SPI Transaction (where applicable), play nice with other SPI devices. 71 | - Almost all chip features supported. 72 | - LGPO Font accellerated rendering. 73 | - Icon support. 74 | - Image support. 75 | - Gradients. 76 | - Icon support (as seen in my last other libraries, use same icon file format). 77 | - Image support (as seen in my last other libraries, use same image file format). 78 | - User Font support (as seen in my last other libraries, use same font file format). 79 | - Uses TFT_ILI9163C command format that have many features and covers commands used in many libraries so it will be easy convert code to work with this one.
80 | 81 | *** 82 | 83 | SSD1331/32 Unique commands: (differs from other libraries due different chip features)
84 | - copyArea: copy a portion of screen into another location (hardware acc.) 85 | - dimArea: dim a selected area (only SSD1331) 86 | - scroll: this chip has an standalone hardware scroll (only SSD1331 and SSD1351) 87 | - defineScrollArea: since scroll is hardware, all is defined inside this function) 88 | - moveArea: It move a defined area into another place (hardware acc.) 89 | - setColorDepth:8 or 16bit 90 | - setColorOrder:RGB or BGR (only SSD1331) 91 | - drawRect: the standard drawRect is provided, but this advanced version have borders. (hardware acc.) (only SSD1331/32) 92 | - mode:PWRSAVE It's almost equal to sleep, display goes off 93 | - mode:DISP_DIM The display goes in Dim mode (only SSD1331) 94 | - mode:PROTECT The chip logic don't accept any commands, just mode:NORMAL to goes off of protect mode.(only SSD1331)
95 | 96 | *** 97 | Connections:
98 | Of course some oled has just SPI exposed but some can be configured for parallel, I2C and so on. I'm using ONLY SPI here (so don't ask for any other protocol please).
99 | - RST Connect to +3v3 using a 4k7->10k resistor. 100 | - scl, sclk -> SCLK 101 | - sda, sdin -> MOSI 102 | - DC,RS ->DC pin on MCU 103 | - some oled has WR, RD. Leave floating... 104 | - some oled has D0...D7. Most of the times D0 and D1 are used for SPI, connect D2...D7 to GND or will be unstable! 105 | - VIN. Most oled support 5v, internally they have regulators, but follow specifications of your particular oled! 106 | - 3v3. This is 99% of the times an OUT! So do not use it.
107 | 108 | *** 109 | Some notes, please read this, will save your time:
110 | - Even if your OLED can work at 5V, it cannot accept logic levels at 5V!!! All OLED accept logic levels at 3v3 so if you plan to use an AVR (like UNO) you need a level converted (like CD4050 or HCF4050 powered at 3v3, very cheap). 111 | - Do not use logic converters based on mosfet or similar or bidirectional ones (Adafruit and Sparkfun sell a lot of these), they are crap, waveforms are distorted and DO NOT USE PARTITION RESISTOR's for that, it's a bad idea, you can damage oled and cpu in the same time. 112 | - Most of you know already this but remember that Arduino UNO or similar can provide 3v3 but the logic levels are always at 5V!!! 113 | - The RST pin is not strictly necessary but if not used must pullup to 3v3, never leave float! When is necessary? When you develop a library for example but if you change libraries you may need a complete power cycle if you are not using this pin. 114 | - ESP8266 has very weak SPI, should be 3v3 but most of the times is much less so better avoid use any logic chip between it and oled, I spend days around a circuit before discovering this. 115 | - On ESP8266, from April 2016 the pin GPIO16 misteriously doesn't works as CS, don't ask me why. I'm currently using GPIO2 or GPIO4. 116 | - Since I'm using the fast SPI possible, keep wires short and remember to provide a decoupling capacitor for your oled.
117 | - If you plan to use SPI for other devices as well it's a good idea pullup the CS with a 10K resistor to +3v3, this will keep oled disabled until your CPU access it for initialization and avoid interferences. 118 | - It's always a good idea provide a pullup for each CS if multiple SPI devices are used, when CPU start all devices are forced disabled and CPU is able to access one by one and initialize all of them correctly, keep in mind and you will happy in the future!
119 | 120 | *** 121 | 122 | Performances (SSD1331):
123 | Early alpha was not working, only garbage on screen, it's here for just for reference
124 | Alpha 1..2 was using absolute screen addressing (now abandoned)
125 | Alpha 3..4 and beta's use hardware rotation addressing. (In Alpha 4 triangles rendering failed)
126 | Beta 1..2 works and are usable, all function tested at any rotation.
127 | CPU used for benchmarks: SSD1331, Teensy 3.2 at 96Mhz. Sketch:benchmarks_official.ino
128 | Times are in Microseconds!
129 | 130 | |test |Early|alpha 1|alpha 2|alpha 3|alpha 4|beta 1|beta 2| 131 | |-------------------|------|------|------|------|------|------|------| 132 | |Screen fill |409|809|807|809|808|507|406| 133 | |Text |3983|3907|3963|3891|2357|2378|2270| 134 | |Text2 |9564|9368|9517|9332|5047|5057|4910| 135 | |Lines |5576|10976|10978|10974|5561|299|277| 136 | |Horiz/Vert Lines|6827|1800|1978|1964|1956|1954|1956| 137 | |Rectangles (outline)|4508|8916|8919|8915|1126|1376|1123| 138 | |Rectangles (filled)|4509|8924|8922|8920|1223|1499|1214| 139 | |Circles (filled)|3635|18787|4488|4482|4481|4479|4481| 140 | |Circles (outline)|4697|2851|2852|2849|2848|2847|2847| 141 | |Triangles (outline)|517|505|508|504|503|204|183| 142 | |Triangles (filled)|1916|11087|4284|4274|276|4274|4275| 143 | |Rounded rects (outline)|1206|2942|1619|1586|1585|1587|1588| 144 | |Rounded rects (filled) |10271|8184|5814|5807|5036|5241|5032| 145 | |Icon Render| | | | ||1404|1312| 146 | 147 | More or less, Beta 2 it's the release candidate, you can note how amazing fast in some operation, for example 406 microsec for a complete screen erase, 277 microsecs for the complete line test or the 183 microsec for the triangle test (remember that triangulation is used for 3d rendering as well, it should be fast), even text it's really fast. In comparison, for the Adafruit one I have to use milliseconds, it's amazing slow (even using the fast SPI mode). I will up a table comparison (for fun) whe I release out this one. 148 | 149 | *** 150 | Licence:
151 | Licensed under GNU V3. 152 | 153 | -------------------------------------------------------------------------------- /_display/SSD_1331_96x64.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1331_96X64_H 2 | #define _SSD_1331_96X64_H 3 | #include 4 | #include "../_includes/SSD_1331_registers.h" 5 | 6 | /*========================================================================================= 7 | Part of SSD_13XX library 8 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 9 | 10 | SSD_13XX Library is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | SSD_13XX Library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Foobar. If not, see . 22 | --------------------------------------------------------------------------------------- 23 | Single Display Parameters 24 | --------------------------------------------------------------------------------------- 25 | Display Type: SSD_1331 96x64 26 | ===========================================================================================*/ 27 | /* Physical display size 28 | */ 29 | static const int16_t SSD_WIDTH = 96; 30 | static const int16_t SSD_HEIGHT = 64; 31 | 32 | static const int CMD_DLY_LINE = 200;//SSD1351 400 33 | static const int CMD_DLY_FILL = 400;//SSD1351 800 34 | static const int CMD_DLY_MIN = 4;//this is the min delay (nicrosec) for this device 35 | 36 | /* Gamma Set*/ 37 | #define SSD_GAMMASET 38 | 39 | static const int16_t SSD_COMSPLIT = 1; //this unit needs com split 40 | static const uint8_t SSD_COLORDEPTH = 16; //8 or 16 41 | static const uint8_t SSD_RGBORDER = 0; //0:RGB 1: 42 | static const uint8_t SSD_DISPLAYOFFSET = 0x00; 43 | static const uint8_t SSD_PHASEPERIOD = 0b10110001; 44 | static const uint8_t SSD_SETMULTIPLEX = 0x3F; 45 | static const uint8_t SSD_STARTLINE = 0x00; 46 | static const uint8_t SSD_SETMASTER = 0x8E; 47 | static const uint8_t SSD_POWERMODE = 0x0B; 48 | static const uint8_t SSD_PRECHARGE = 0x31; 49 | static const uint8_t SSD_CLOCKDIV = 0xF0; 50 | static const uint8_t SSD_PRECHARGE_A = 0x64; 51 | static const uint8_t SSD_PRECHARGE_B = 0x78; 52 | static const uint8_t SSD_PRECHARGE_C = 0x64; 53 | static const uint8_t SSD_PRECHARGELEVEL = 0x3A; 54 | static const uint8_t SSD_VCOMH = 0x3E; 55 | static const uint8_t SSD_MASTERCURRENT = 0x06; 56 | static const uint8_t SSD_CONTRAST_A = 0x91; 57 | static const uint8_t SSD_CONTRAST_B = 0x50; 58 | static const uint8_t SSD_CONTRAST_C = 0x7D; 59 | static const uint8_t SSD_VPACOLORLVL = 0b00111111; 60 | static const uint8_t SSD_VPBCOLORLVL = 0b00111111; 61 | static const uint8_t SSD_VPCCOLORLVL = 0b00111111; 62 | static const uint8_t SSD_DIMMDESET_A = 128; 63 | static const uint8_t SSD_DIMMDESET_B = 128; 64 | static const uint8_t SSD_DIMMDESET_C = 128; 65 | static const uint8_t SSD_DIMMDESET_PC = 0x0F;//max 0x1F 66 | 67 | #if defined(SSD_GAMMASET) 68 | static const uint8_t SSD_GRAYTABLE[32]= {0x01,0x03,0x05,0x07,0x0A,0x0D,0x10,0x13,0x16,0x19,0x1C,0x20,0x24,0x28,0x2C,0x30,0x34,0x38,0x3C,0x40,0x44,0x48,0x4C,0x50,0x54,0x58,0x5C,0x60,0x64,0x68,0x6C,0x70}; 69 | #endif 70 | #endif -------------------------------------------------------------------------------- /_display/SSD_1331_REDPCB.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1331_96X64_H 2 | #define _SSD_1331_96X64_H 3 | #include 4 | #include "../_includes/SSD_1331_registers.h" 5 | 6 | /*========================================================================================= 7 | Part of SSD_13XX library 8 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 9 | 10 | SSD_13XX Library is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | SSD_13XX Library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Foobar. If not, see . 22 | --------------------------------------------------------------------------------------- 23 | Single Display Parameters 24 | --------------------------------------------------------------------------------------- 25 | Display Type: SSD_1331 RED PCB 0.96" color oled 26 | ===========================================================================================*/ 27 | /* Physical display size 28 | */ 29 | static const int16_t SSD_WIDTH = 96; 30 | static const int16_t SSD_HEIGHT = 64; 31 | /* Hardware timings (If you see garbage on screen try increase those) */ 32 | static const int CMD_DLY_LINE = 400;//SSD1351 400 33 | static const int CMD_DLY_FILL = 800;//SSD1351 800 34 | static const int CMD_DLY_MIN = 10;//this is the min delay (nicrosec) for this device 35 | 36 | /* Gamma Set*/ 37 | #define SSD_GAMMASET 38 | 39 | static const int16_t SSD_COMSPLIT = 1; //this unit needs com split 40 | static const uint8_t SSD_COLORDEPTH = 16; //8 or 16 41 | static const uint8_t SSD_RGBORDER = 0; //0:RGB 1: 42 | static const uint8_t SSD_DISPLAYOFFSET = 0x00; 43 | static const uint8_t SSD_PHASEPERIOD = 0b10110001; 44 | static const uint8_t SSD_SETMULTIPLEX = 0x3F; 45 | static const uint8_t SSD_STARTLINE = 0x00; 46 | static const uint8_t SSD_SETMASTER = 0x8E; 47 | static const uint8_t SSD_POWERMODE = 0x0B; 48 | static const uint8_t SSD_PRECHARGE = 0x31; 49 | static const uint8_t SSD_CLOCKDIV = 0xF0; 50 | static const uint8_t SSD_PRECHARGE_A = 0x64; 51 | static const uint8_t SSD_PRECHARGE_B = 0x78; 52 | static const uint8_t SSD_PRECHARGE_C = 0x64; 53 | static const uint8_t SSD_PRECHARGELEVEL = 0x3A; 54 | static const uint8_t SSD_VCOMH = 0x3E; 55 | static const uint8_t SSD_MASTERCURRENT = 0x06; 56 | static const uint8_t SSD_CONTRAST_A = 0x91; 57 | static const uint8_t SSD_CONTRAST_B = 0x50; 58 | static const uint8_t SSD_CONTRAST_C = 0x7D; 59 | static const uint8_t SSD_VPACOLORLVL = 0b00111111; 60 | static const uint8_t SSD_VPBCOLORLVL = 0b00111111; 61 | static const uint8_t SSD_VPCCOLORLVL = 0b00111111; 62 | static const uint8_t SSD_DIMMDESET_A = 128; 63 | static const uint8_t SSD_DIMMDESET_B = 128; 64 | static const uint8_t SSD_DIMMDESET_C = 128; 65 | static const uint8_t SSD_DIMMDESET_PC = 0x0F;//max 0x1F 66 | 67 | #if defined(SSD_GAMMASET) 68 | static const uint8_t SSD_GRAYTABLE[32]= {0x01,0x03,0x05,0x07,0x0A,0x0D,0x10,0x13,0x16,0x19,0x1C,0x20,0x24,0x28,0x2C,0x30,0x34,0x38,0x3C,0x40,0x44,0x48,0x4C,0x50,0x54,0x58,0x5C,0x60,0x64,0x68,0x6C,0x70}; 69 | #endif 70 | #endif -------------------------------------------------------------------------------- /_display/SSD_1332_96x64.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1332_96X64_H 2 | #define _SSD_1332_96X64_H 3 | #include 4 | #include "../_includes/SSD_1332_registers.h" 5 | 6 | /*========================================================================================= 7 | Part of SSD_13XX library 8 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 9 | 10 | SSD_13XX Library is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | SSD_13XX Library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Foobar. If not, see . 22 | --------------------------------------------------------------------------------------- 23 | Single Display Parameters 24 | --------------------------------------------------------------------------------------- 25 | Display Type: SSD_1332 96x64 26 | ===========================================================================================*/ 27 | /* Physical display size 28 | */ 29 | static const int16_t SSD_WIDTH = 96; 30 | static const int16_t SSD_HEIGHT = 64; 31 | 32 | static const int CMD_DLY_LINE = 300;//400 33 | static const int CMD_DLY_FILL = 600;//800 34 | static const int CMD_DLY_MIN = 10; 35 | 36 | /* Gamma Set*/ 37 | //#define SSD_GAMMASET 38 | 39 | static const int16_t SSD_COMSPLIT = 1; //this unit needs com split 40 | static const uint8_t SSD_COLORDEPTH = 16; //8 or 16 41 | static const uint8_t SSD_RGBORDER = 0; //0:RGB 1: 42 | static const uint8_t SSD_DISPLAYOFFSET = 0x00;//0...63 43 | static const uint8_t SSD_PHASEPERIOD = 0b10110001; 44 | static const uint8_t SSD_SETMULTIPLEX = 0x3F; 45 | static const uint8_t SSD_STARTLINE = 0x00;//0...63 46 | static const uint8_t SSD_SETMASTER = 0x8F;//(0x8E)10001 110 47 | /* 10001 a2 a1 a0 48 | A[0]=0, Select external VCC supply at Display ON 49 | A[0]=1, Select internal booster at Display ON (POR) 50 | A[1]=0, Select external VCOMH voltage supply at Display ON 51 | A[1]=1, Select internal VCOMH regulator at Display ON (POR) 52 | A[2]=0, Select External VP voltage supply 53 | A[2]=1, Select Internal VP (POR) 54 | */ 55 | static const uint8_t SSD_POWERMODE = 0x0B;//0x0B;//0b00001011 56 | //static const uint8_t SSD_PRECHARGE = 0x31;//0x31//0x1F; 57 | static const uint8_t SSD_CLOCKDIV = 0xF0;//F0 58 | //static const uint8_t SSD_PRECHARGE_A = 0x64;//64 59 | //static const uint8_t SSD_PRECHARGE_B = 0x78;//78 60 | //static const uint8_t SSD_PRECHARGE_C = 0x64;//64 61 | //static const uint8_t SSD_PRECHARGELEVEL = 0x1A;//3A 62 | static const uint8_t SSD_VCOMH = 0x3E;//3E 63 | static const uint8_t SSD_MASTERCURRENT = 0x0F;//0x06 0...16 64 | static const uint8_t SSD_CONTRAST_A = 0x91;//91 0...255 65 | static const uint8_t SSD_CONTRAST_B = 0x50;//50 0...255 66 | static const uint8_t SSD_CONTRAST_C = 0x7D;//7D 0...255 67 | /* 68 | A[7:0] 00000000 0.43*Vref 00111111 0.83*Vref 01111111 1.0*Vref 1xxxxxxx connects to VCOMH (POR) 69 | */ 70 | static const uint8_t SSD_VPACOLORLVL = 0b00111111; 71 | static const uint8_t SSD_VPBCOLORLVL = 0b00111111; 72 | static const uint8_t SSD_VPCCOLORLVL = 0b00111111; 73 | //static const uint8_t SSD_DIMMDESET_A = 128; 74 | //static const uint8_t SSD_DIMMDESET_B = 128; 75 | //static const uint8_t SSD_DIMMDESET_C = 128; 76 | //static const uint8_t SSD_DIMMDESET_PC = 0x0F;//max 0x1F 77 | #if defined(SSD_GAMMASET) 78 | static const uint8_t SSD_GRAYTABLE[32]= {0x01,0x03,0x05,0x07,0x0A,0x0D,0x10,0x13,0x16,0x19,0x1C,0x20,0x24,0x28,0x2C,0x30,0x34,0x38,0x3C,0x40,0x44,0x48,0x4C,0x50,0x54,0x58,0x5C,0x60,0x64,0x68,0x6C,0x70}; 79 | #endif 80 | #endif -------------------------------------------------------------------------------- /_display/SSD_1351_128x128.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1351_128X128_H 2 | #define _SSD_1351_128X128_H 3 | #include 4 | #include "../_includes/SSD_1351_registers.h" 5 | 6 | /*========================================================================================= 7 | Part of SSD_13XX library 8 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 9 | 10 | SSD_13XX Library is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | SSD_13XX Library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Foobar. If not, see . 22 | --------------------------------------------------------------------------------------- 23 | Single Display Parameters 24 | --------------------------------------------------------------------------------------- 25 | Display Type: SSD_1351 128 x 128 (1.5") 26 | ===========================================================================================*/ 27 | /* Physical display size 28 | */ 29 | static const int16_t SSD_WIDTH = 128; 30 | static const int16_t SSD_HEIGHT = 128; 31 | 32 | 33 | static const int16_t SSD_COMSPLIT = 1; //this unit needs com split 34 | static const uint8_t SSD_COLORDEPTH = 16; //8 or 16 35 | static const uint8_t SSD_RGBORDER = 1; //0:RGB 1: 36 | static const bool SSD_ENHANCE = 1; 37 | static const uint8_t SSD_COMMANDLOCK1 = 0x12; 38 | static const uint8_t SSD_COMMANDLOCK2 = 0xB1; 39 | static const uint8_t SSD_MUXRATIO = 0x7F; 40 | static const uint8_t SSD_SETGPIO = 0x00; 41 | static const uint8_t SSD_PRECHARGE2 = 0x01; 42 | static const uint8_t SSD_CONTRASTMASTER = 0x0F; 43 | static const uint8_t SSD_FUNCTIONSELECT = 0x01; 44 | static const uint8_t SSD_DISPLAYOFFSET = 0x00; 45 | static const uint8_t SSD_PHASEPERIOD = 0b10110001; 46 | static const uint8_t SSD_SETMULTIPLEX = 0x3F; 47 | static const uint8_t SSD_STARTLINE = 0x00; 48 | static const uint8_t SSD_FILL = 0x01; 49 | static const uint8_t SSD_SETMASTER = 0x8E; 50 | static const uint8_t SSD_POWERMODE = 0x0B; 51 | static const uint8_t SSD_PRECHARGE = 0x32; 52 | static const uint8_t SSD_CLOCKDIV = 0xF1; 53 | static const uint8_t SSD_SETVSL_A = 0xA0; 54 | static const uint8_t SSD_SETVSL_B = 0xB5; 55 | static const uint8_t SSD_SETVSL_C = 0x55; 56 | static const uint8_t SSD_PRECHARGELEVEL = 0x3A; 57 | static const uint8_t SSD_VCOMH = 0x05; 58 | static const uint8_t SSD_MASTERCURRENT = 0x0F;//0x06 59 | static const uint8_t SSD_CONTRAST_A = 0xC8; 60 | static const uint8_t SSD_CONTRAST_B = 0x80; 61 | static const uint8_t SSD_CONTRAST_C = 0xC8; 62 | 63 | #endif -------------------------------------------------------------------------------- /_display/SSD_1351_128x96.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1351_128X96_H 2 | #define _SSD_1351_128X96_H 3 | #include 4 | #include "../_includes/SSD_1351_registers.h" 5 | 6 | /*========================================================================================= 7 | Part of SSD_13XX library 8 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 9 | 10 | SSD_13XX Library is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | SSD_13XX Library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with Foobar. If not, see . 22 | --------------------------------------------------------------------------------------- 23 | Single Display Parameters 24 | --------------------------------------------------------------------------------------- 25 | Display Type: SSD_1351 128 x 96 (never tested) 26 | ===========================================================================================*/ 27 | /* Physical display size 28 | */ 29 | static const int16_t SSD_WIDTH = 128; 30 | static const int16_t SSD_HEIGHT = 96; 31 | 32 | 33 | static const int16_t SSD_COMSPLIT = 1; //this unit needs com split 34 | static const uint8_t SSD_COLORDEPTH = 16; //8 or 16 35 | static const uint8_t SSD_RGBORDER = 1; //0:RGB 1: 36 | static const bool SSD_ENHANCE = 1; 37 | static const uint8_t SSD_COMMANDLOCK1 = 0x12; 38 | static const uint8_t SSD_COMMANDLOCK2 = 0xB1; 39 | static const uint8_t SSD_MUXRATIO = 0x7F; 40 | static const uint8_t SSD_SETGPIO = 0x00; 41 | static const uint8_t SSD_PRECHARGE2 = 0x01; 42 | static const uint8_t SSD_CONTRASTMASTER = 0x0F; 43 | static const uint8_t SSD_FUNCTIONSELECT = 0x01; 44 | static const uint8_t SSD_DISPLAYOFFSET = 0x00; 45 | static const uint8_t SSD_PHASEPERIOD = 0b10110001; 46 | static const uint8_t SSD_SETMULTIPLEX = 0x3F; 47 | static const uint8_t SSD_STARTLINE = SSD_HEIGHT; 48 | static const uint8_t SSD_FILL = 0x01; 49 | static const uint8_t SSD_SETMASTER = 0x8E; 50 | static const uint8_t SSD_POWERMODE = 0x0B; 51 | static const uint8_t SSD_PRECHARGE = 0x32; 52 | static const uint8_t SSD_CLOCKDIV = 0xF1; 53 | static const uint8_t SSD_SETVSL_A = 0xA0; 54 | static const uint8_t SSD_SETVSL_B = 0xB5; 55 | static const uint8_t SSD_SETVSL_C = 0x55; 56 | static const uint8_t SSD_PRECHARGELEVEL = 0x3A; 57 | static const uint8_t SSD_VCOMH = 0x05; 58 | static const uint8_t SSD_MASTERCURRENT = 0x0F;//0x06 59 | static const uint8_t SSD_CONTRAST_A = 0xC8; 60 | static const uint8_t SSD_CONTRAST_B = 0x80; 61 | static const uint8_t SSD_CONTRAST_C = 0xC8; 62 | 63 | #endif -------------------------------------------------------------------------------- /_fonts/nullfont.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | 4 | Null Font v2.4 5 | *******************************************************************************/ 6 | 7 | #if !defined(SUMO_FNT_LIB_nullfont) 8 | #define SUMO_FNT_LIB_nullfont 9 | 10 | #include 11 | 12 | 13 | 14 | const _smCharType image_data_nullfont_0x20[1] 15 | #if defined(_FORCE_PROGMEM__) 16 | PROGMEM 17 | #endif 18 | = { 0x00 };////character: ' ' 19 | 20 | const tImage nullfont_0x20 21 | #if defined(_FORCE_PROGMEM__) 22 | PROGMEM 23 | #endif 24 | = { image_data_nullfont_0x20, 25 | 2, 1};//character: ' ' , height: 9, (charW,total bytes) 26 | 27 | 28 | const tChar nullfont_array[] = { 29 | 30 | // character: ' ' 31 | {0x20, &nullfont_0x20} 32 | 33 | }; 34 | 35 | //num chars, array, width, height, descent, compression 36 | 37 | const tFont nullfont = { 1, nullfont_array, RLE_monospaced, 9, 0, RLE_no, 0 }; 38 | 39 | #endif -------------------------------------------------------------------------------- /_icons/mixer1.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: mixer1 4 | * 5 | * preset name: sumotoy_icon 6 | * data block size: 8 bit(s), uint8_t 7 | * RLE compression enabled: no 8 | * conversion type: Monochrome, Edge 144 9 | * bits per pixel: 1 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.3 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_mixer1) 22 | #define SUMO_ICN_LIB_mixer1 23 | 24 | #include 25 | 26 | 27 | 28 | 29 | 30 | static const _smCharType image_data_mixer1[113] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {0xe0, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0x00, 0xf9, 0xfe, 0x7c, 0x03, 0xe7, 0xf9, 0xf0, 0x0f, 0x9f, 0xe7, 0xc0, 0x3c, 0x3f, 0x9f, 0x00, 0xe0, 0x7e, 0x7c, 0x03, 0x81, 0xf9, 0xf0, 0x0e, 0x07, 0xe7, 0xc0, 0x38, 0x1f, 0x9f, 0x00, 0xf0, 0xfe, 0x7c, 0x03, 0xe7, 0xf0, 0xf0, 0x0f, 0x9f, 0x81, 0xc0, 0x3e, 0x7e, 0x07, 0x00, 0xf9, 0xf8, 0x1c, 0x03, 0xe7, 0xe0, 0x70, 0x0f, 0x9f, 0xc3, 0xc0, 0x3e, 0x7f, 0x9f, 0x00, 0xf9, 0xfe, 0x7c, 0x03, 0xe7, 0xf9, 0xf0, 0x0f, 0xff, 0xff, 0xc0, 0x3f, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x01, 0xc0, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0x70}; 35 | 36 | static const tIcon mixer1 = { image_data_mixer1, 30, 30, 113, RLE_no }; 37 | 38 | 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /_icons/spkOff.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: spkOff 4 | * 5 | * preset name: sumotoy_icon 6 | * data block size: 8 bit(s), uint8_t 7 | * RLE compression enabled: no 8 | * conversion type: Monochrome, Edge 144 9 | * bits per pixel: 1 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.3 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_spkOff) 22 | #define SUMO_ICN_LIB_spkOff 23 | 24 | #include 25 | 26 | 27 | 28 | 29 | 30 | static const _smCharType image_data_spkOff[94] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xfc, 0x0f, 0xff, 0xc1, 0xe0, 0x3f, 0xfe, 0x06, 0x00, 0xff, 0xf8, 0x18, 0x03, 0xff, 0xe0, 0x60, 0x0f, 0xff, 0x81, 0x80, 0x3f, 0xfe, 0x06, 0x00, 0xff, 0xf8, 0x18, 0x03, 0xff, 0xe0, 0x60, 0x0f, 0xff, 0x81, 0x80, 0x7f, 0xfe, 0x06, 0x02, 0x3f, 0x88, 0x18, 0x08, 0x7c, 0x20, 0x60, 0x30, 0xe1, 0x81, 0x80, 0x61, 0x0e, 0x06, 0x00, 0xc0, 0x78, 0x18, 0x03, 0x83, 0xf0, 0x70, 0x0e, 0x0f, 0xff, 0xf0, 0x30, 0x1f, 0xff, 0xf1, 0x84, 0x3f, 0xff, 0xec, 0x38, 0x7f, 0xff, 0xe1, 0xf0, 0xff, 0xff, 0x8f, 0xe0}; 35 | 36 | static const tIcon spkOff = { image_data_spkOff, 30, 25, 94, RLE_no }; 37 | 38 | 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /_icons/spkOn.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: spkOn 4 | * 5 | * preset name: sumotoy_icon 6 | * data block size: 8 bit(s), uint8_t 7 | * RLE compression enabled: no 8 | * conversion type: Monochrome, Edge 144 9 | * bits per pixel: 1 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.3 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_spkOn) 22 | #define SUMO_ICN_LIB_spkOn 23 | 24 | #include 25 | 26 | 27 | 28 | static const _smCharType image_data_spkOn[94] 29 | #if defined(_FORCE_PROGMEM__) 30 | PROGMEM 31 | #endif 32 | = {0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xc3, 0xff, 0xff, 0xfc, 0x0f, 0xcf, 0xc1, 0xe0, 0x3f, 0x1e, 0x06, 0x00, 0xfe, 0x38, 0x18, 0x03, 0x3c, 0xe0, 0x60, 0x0e, 0x71, 0x81, 0x80, 0x3c, 0xe6, 0x06, 0x00, 0xf1, 0x98, 0x18, 0x06, 0xe6, 0x60, 0x60, 0x19, 0x99, 0x81, 0x80, 0x66, 0x66, 0x06, 0x01, 0xb9, 0x98, 0x18, 0x03, 0xc6, 0x60, 0x60, 0x0f, 0x39, 0x81, 0x80, 0x39, 0xe6, 0x06, 0x00, 0xcf, 0x38, 0x18, 0x03, 0xf8, 0xf0, 0x70, 0x0f, 0xc7, 0xff, 0xf0, 0x3f, 0x3f, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc}; 33 | 34 | static const tIcon spkOn = { image_data_spkOn, 30, 25, 94, RLE_no }; 35 | 36 | #endif 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /_icons/wifi.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: wifi 4 | * 5 | * preset name: sumotoy_icon 6 | * data block size: 8 bit(s), uint8_t 7 | * RLE compression enabled: no 8 | * conversion type: Monochrome, Edge 144 9 | * bits per pixel: 1 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.3 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_wifi) 22 | #define SUMO_ICN_LIB_wifi 23 | 24 | #include 25 | 26 | 27 | 28 | 29 | 30 | static const _smCharType image_data_wifi[126] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {0xff, 0xfe, 0x07, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xff, 0xe0, 0x00, 0x3f, 0xff, 0xf8, 0x00, 0x01, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xfe, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x7f, 0xf1, 0x00, 0x00, 0x0f, 0xff, 0x81, 0x99, 0xb1, 0x80, 0x9c, 0x19, 0x9b, 0x18, 0x09, 0xc0, 0x99, 0x31, 0x9f, 0x9c, 0x0f, 0xf0, 0x19, 0xff, 0xc0, 0xff, 0x31, 0x81, 0x9c, 0x0f, 0xf3, 0x18, 0x19, 0xc0, 0xe7, 0x31, 0x9f, 0x9c, 0x06, 0x63, 0x19, 0xf9, 0xc0, 0x66, 0x31, 0x9f, 0x9c, 0x00, 0x00, 0x1f, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xf8, 0x80, 0x00, 0x7f, 0xff, 0x18, 0x00, 0x00, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x00, 0x7f, 0xe0, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x1f, 0xff, 0xfc, 0x00, 0x03, 0xff, 0xff, 0xe0, 0x00, 0xff, 0xff, 0xff, 0x80, 0x3f, 0xff}; 35 | 36 | static const tIcon wifi = { image_data_wifi, 36, 28, 126, RLE_no }; 37 | 38 | 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /_icons/world.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: world 4 | * 5 | * preset name: sumotoy_icon 6 | * data block size: 8 bit(s), uint8_t 7 | * RLE compression enabled: no 8 | * conversion type: Monochrome, Edge 144 9 | * bits per pixel: 1 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: yes 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.3 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_world) 22 | #define SUMO_ICN_LIB_world 23 | 24 | #include 25 | 26 | 27 | 28 | 29 | 30 | static const _smCharType image_data_world[2048] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {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, 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, 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, 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, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x13, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x3e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0xf8, 0x1f, 0xe1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x0f, 0xff, 0x0f, 0xfc, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x3f, 0xff, 0x07, 0xcf, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x7f, 0xbe, 0x03, 0x81, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x81, 0x60, 0x00, 0x00, 0xc0, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x0e, 0x00, 0x01, 0xfc, 0x10, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x1e, 0x00, 0x03, 0xfe, 0x3c, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x3c, 0xf9, 0x07, 0xff, 0x3e, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xf7, 0xfe, 0x07, 0xff, 0xff, 0x80, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x83, 0x86, 0xff, 0x07, 0xff, 0xff, 0xc0, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x71, 0x30, 0x07, 0xff, 0xff, 0xf0, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x7e, 0x00, 0x03, 0xff, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x7b, 0x00, 0x03, 0xff, 0xff, 0xfc, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x01, 0xf8, 0x00, 0x01, 0xff, 0xff, 0xfe, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x3f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff, 0x90, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xf0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0x98, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0f, 0xf0, 0x00, 0x00, 0xff, 0xff, 0xff, 0x88, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x0f, 0xf9, 0x30, 0x00, 0x3f, 0xff, 0xff, 0x8e, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xff, 0xf8, 0x00, 0x1f, 0xff, 0xff, 0x8f, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x7f, 0xff, 0xf0, 0x00, 0x1f, 0xff, 0xff, 0x8f, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x20, 0x7f, 0xff, 0xe0, 0x00, 0x07, 0xff, 0xff, 0xc7, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x40, 0xfc, 0x7f, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xf3, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xc0, 0xfe, 0x1f, 0x80, 0x00, 0x07, 0xff, 0xff, 0xf3, 0x80, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xd7, 0xe4, 0x1f, 0x00, 0x00, 0x07, 0xff, 0xff, 0xf1, 0xc0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xf7, 0xc0, 0x00, 0x00, 0x00, 0x01, 0xff, 0xff, 0xf0, 0xc0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xe0, 0x9f, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xc0, 0x00, 0x00, 0x48, 0x00, 0x7f, 0xff, 0xf8, 0x61, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xc0, 0x00, 0x01, 0xf0, 0x00, 0x07, 0xff, 0xf8, 0x01, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xe0, 0x00, 0x0f, 0xc0, 0x00, 0x00, 0x7f, 0xf8, 0x01, 0xcf, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xfa, 0x20, 0x00, 0x1f, 0x80, 0x00, 0x00, 0x0f, 0xf8, 0x03, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xe2, 0x20, 0x00, 0x3f, 0x80, 0x00, 0x00, 0x06, 0x78, 0x03, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xcf, 0x0c, 0x01, 0x00, 0x3f, 0xc0, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xce, 0x98, 0x05, 0x01, 0x22, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xdf, 0x00, 0x01, 0x81, 0x42, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x03, 0xe3, 0xff, 0xff, 0xff, 0xff, 0x9f, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf8, 0x03, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x03, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x9e, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe0, 0x01, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0x03, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x9c, 0x00, 0x1c, 0x44, 0x00, 0x00, 0x00, 0x02, 0x01, 0x80, 0x03, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x9c, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x03, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0c, 0xc0, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x70, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x40, 0x80, 0x00, 0x00, 0x03, 0xc0, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1e, 0x10, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1f, 0x00, 0x01, 0xe0, 0x00, 0x00, 0x60, 0x00, 0x03, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x1f, 0x80, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x30, 0x3e, 0x00, 0x01, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x1c, 0x1c, 0x08, 0x03, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x00, 0x0e, 0x08, 0x00, 0x03, 0xf8, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xf8, 0xff, 0xff, 0xff, 0xff, 0x80, 0x07, 0x00, 0x60, 0x0f, 0xf8, 0xc0, 0x00, 0x00, 0x00, 0x07, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x01, 0xe0, 0x80, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x1f, 0xf1, 0x80, 0x0f, 0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x03, 0xfe, 0x00, 0x07, 0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x04, 0xfc, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0f, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x03, 0x00, 0x00, 0x0f, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0f, 0xf9, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x0f, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x03, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x0f, 0xf1, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x01, 0xff, 0xf8, 0x00, 0x00, 0x00, 0x1f, 0xf1, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x1f, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00, 0x01, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x00, 0x00, 0x01, 0xff, 0x80, 0x00, 0x00, 0x07, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x01, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x01, 0xff, 0x8f, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x07, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x1f, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x20, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x07, 0xff, 0xff, 0xff, 0xe0, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x07, 0xff, 0xff, 0xfe, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x07, 0xff, 0xff, 0xfe, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x07, 0xff, 0xff, 0xf0, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x01, 0xff, 0xff, 0xf0, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0x00, 0x00, 0x3f, 0xff, 0xf0, 0x00, 0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x00, 0x00, 0x03, 0xff, 0xc0, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x7f, 0x80, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x00, 0x00, 0x3f, 0x00, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x1c, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc0, 0x03, 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, 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, 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, 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, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 35 | 36 | static const tIcon world = { image_data_world, 128, 128, 2048, RLE_no }; 37 | 38 | 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /_images/wifi2s.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: wifi2s 4 | * 5 | * preset name: sumotoy_icon2 6 | * data block size: 16 bit(s), uint16_t 7 | * RLE compression enabled: no 8 | * conversion type: Color, not_used not_used 9 | * bits per pixel: 16 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Image template version: 1.3 18 | * Note: 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_IMG_LIB_wifi2s) 22 | #define SUMO_IMG_LIB_wifi2s 23 | 24 | #include 25 | 26 | static const uint16_t image_data_wifi2s[580] 27 | #if defined(_FORCE_PROGMEM__) 28 | PROGMEM 29 | #endif 30 | = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x10c2, 0x1b03, 0x0c81, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0ca0, 0x1ba3, 0x1142, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x19c3, 0x1462, 0x0460, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0460, 0x2264, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2224, 0x0420, 0x0460, 0x0480, 0x0480, 0x0480, 0x0480, 0x0ca0, 0x0ca0, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0420, 0x3367, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0060, 0x1242, 0x1342, 0x03a0, 0x0bc1, 0x0c61, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0420, 0x0420, 0x0460, 0x0460, 0x0460, 0x0420, 0x0bc2, 0x03a0, 0x0b42, 0x0a22, 0x08a2, 0x0000, 0x0000, 0x1923, 0x0bc1, 0x0480, 0x0480, 0x0480, 0x0460, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0460, 0x0480, 0x0480, 0x0480, 0x0420, 0x2c82, 0xa687, 0xcf09, 0xc6c8, 0xc6c8, 0xbec7, 0xb6a6, 0xc6e7, 0xcf27, 0x8e25, 0x0c00, 0x0961, 0x0000, 0x0c42, 0x0460, 0x0460, 0x0460, 0x0480, 0x0420, 0x0460, 0x0480, 0x0420, 0x0460, 0x0ca0, 0x24c2, 0x0480, 0x0480, 0x0420, 0x3ce2, 0xffaa, 0xffea, 0xffc9, 0xffc9, 0xffc9, 0xffea, 0xffc9, 0xf7a8, 0xe748, 0xffea, 0xc6e7, 0x0c00, 0x1122, 0x03e0, 0x2ce2, 0xd709, 0x75c5, 0x1461, 0xcf09, 0x6584, 0x1482, 0xcf09, 0x6564, 0x6dc5, 0xffec, 0x4d43, 0x0420, 0x0c61, 0xdf49, 0xffc9, 0x4523, 0x34c1, 0x14a0, 0x14a0, 0x1440, 0x75a5, 0xbe88, 0x0340, 0x6584, 0xffec, 0x8604, 0x1303, 0x0460, 0x0c81, 0xffea, 0xbec7, 0x4d04, 0xffeb, 0xae87, 0x4d04, 0xffec, 0x6da4, 0x2c82, 0x8e07, 0x24c1, 0x0420, 0x34c2, 0xffc9, 0xe749, 0x0460, 0x03e0, 0x2ce2, 0x2ce2, 0x2c82, 0x6d65, 0xdf29, 0x6d66, 0xae87, 0xf7c9, 0xd728, 0x13e1, 0x0480, 0x0420, 0xbe88, 0xcf27, 0x8606, 0xffea, 0xb6a7, 0x8606, 0xffea, 0x14a1, 0x4d22, 0xcee9, 0x2ce2, 0x0420, 0x44e3, 0xffaa, 0xe749, 0x0460, 0x1cc2, 0xffec, 0xffeb, 0xffea, 0xffea, 0xb6a7, 0x34a3, 0x9e66, 0xffa9, 0xdf28, 0x0c00, 0x0480, 0x0420, 0x7dc5, 0xf7aa, 0xcf09, 0xd728, 0xbe88, 0xdf29, 0xdf28, 0x03e0, 0x75c4, 0xffec, 0x3ce3, 0x03e0, 0x44e3, 0xffaa, 0xe749, 0x1ca1, 0x0460, 0x24e0, 0x24e0, 0x1c40, 0xcec7, 0xc708, 0x0340, 0x7de4, 0xffea, 0xd728, 0x0c00, 0x0480, 0x0420, 0x3d03, 0xffaa, 0xffa9, 0x75a5, 0xb6a7, 0xffea, 0xa666, 0x03a0, 0x75c4, 0xffeb, 0x3503, 0x03e0, 0x3ce2, 0xffa9, 0xe749, 0x1ca1, 0x0460, 0x2cc3, 0x2cc3, 0x2443, 0xc6c8, 0xcf08, 0x03a0, 0x8605, 0xffea, 0xd728, 0x0c00, 0x0480, 0x0480, 0x0c81, 0xf769, 0xffea, 0x34a3, 0xa666, 0xffec, 0x6da5, 0x0340, 0x8605, 0xffec, 0x3ce3, 0x03e0, 0x44e3, 0xffaa, 0xe749, 0x03e0, 0x0460, 0xffec, 0xffea, 0xf7aa, 0xffea, 0x9e66, 0x0340, 0x7de4, 0xffea, 0xdf49, 0x13e0, 0x0480, 0x0480, 0x0460, 0x9626, 0xc708, 0x0460, 0x6584, 0xc729, 0x2ce2, 0x03e0, 0x6584, 0xc729, 0x2ce2, 0x03a0, 0x6584, 0xffea, 0xdf28, 0x3ce2, 0x4d23, 0xef69, 0xdf48, 0xdf48, 0xf789, 0xb6a7, 0x3442, 0x9625, 0xffea, 0xaea5, 0x0b42, 0x0460, 0x0480, 0x0480, 0x0460, 0x0460, 0x0480, 0x0460, 0x0420, 0x0480, 0x0480, 0x0460, 0x0420, 0x0460, 0x0420, 0xc6c8, 0xf789, 0xdf48, 0xf789, 0xf789, 0xdf48, 0xdf48, 0xdf48, 0xdf28, 0xe748, 0xf789, 0xffc9, 0xffc9, 0x2c80, 0x19c4, 0x2a65, 0x0420, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0c00, 0x9e47, 0xffeb, 0xf789, 0xf789, 0xffa9, 0xf789, 0xf789, 0xf789, 0xf789, 0xf7a8, 0xf7a8, 0xf7c9, 0xd728, 0x3cc1, 0x0282, 0x0000, 0x0000, 0x19a3, 0x13a2, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x14a1, 0x5d83, 0x3d42, 0x3d42, 0x3d42, 0x3d42, 0x3d42, 0x3d42, 0x3d42, 0x2d20, 0x3541, 0x3d61, 0x3d22, 0x13a2, 0x0a22, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x08c1, 0x10c2, 0x1081, 0x1a03, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0420, 0x0420, 0x0420, 0x0460, 0x0420, 0x0420, 0x0420, 0x0420, 0x0a83, 0x08a1, 0x08a2, 0x08c1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x19c3, 0x0c42, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x2264, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1081, 0x12c2, 0x0c61, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x0480, 0x1b63, 0x1122, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x08a1, 0x1a03, 0x1ae3, 0x0b61, 0x0b61, 0x2304, 0x2224, 0x08c1, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};// 16 31 | static const tPicture wifi2s = { image_data_wifi2s, 29, 20, 580, 16, RLE_no}; 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /_images/wifi2sr.c: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************* 3 | * name: wifi2sr 4 | * 5 | * preset name: sumotoy_icon2 6 | * data block size: 16 bit(s), uint16_t 7 | * RLE compression enabled: no 8 | * conversion type: Color, not_used not_used 9 | * bits per pixel: 16 10 | * 11 | * preprocess: 12 | * main scan direction: top_to_bottom 13 | * line scan direction: forward 14 | * inverse: no 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Image template version: 1.3 18 | * Note: 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_IMG_LIB_wifi2sr) 22 | #define SUMO_IMG_LIB_wifi2sr 23 | 24 | #include 25 | 26 | static const uint16_t image_data_wifi2sr[580] 27 | #if defined(_FORCE_PROGMEM__) 28 | PROGMEM 29 | #endif 30 | = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2082, 0xa145, 0xf924, 0xf904, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xc165, 0x48a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x60e3, 0xf945, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8c3, 0x8945, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6945, 0xf8c3, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf8a2, 0xa208, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1041, 0x80e3, 0xc104, 0xc8c3, 0xc924, 0xf904, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf8a2, 0xf8e3, 0xf8e3, 0xf8e3, 0xf8c3, 0xd104, 0xc8a2, 0xc0c3, 0x8882, 0x2061, 0x0000, 0x0000, 0x30c3, 0xe8e3, 0xf8e3, 0xf904, 0xf904, 0xf8e3, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf8e3, 0xf904, 0xf904, 0xf924, 0xf8a2, 0xf965, 0xfb4d, 0xfbcf, 0xfbae, 0xfbae, 0xfb8e, 0xfb4d, 0xfb8e, 0xfbae, 0xfacb, 0xf8c3, 0x5082, 0x0000, 0xf145, 0xf8e3, 0xf8c3, 0xf8c3, 0xf904, 0xf8a2, 0xf8e3, 0xf904, 0xf8a2, 0xf8e3, 0xf924, 0xf965, 0xf904, 0xf904, 0xf8c3, 0xf986, 0xfc92, 0xfcd3, 0xfc92, 0xfc92, 0xfc92, 0xfc92, 0xfc92, 0xfc30, 0xfc10, 0xfcb2, 0xfb8e, 0xf8c3, 0x2882, 0xf8a2, 0xf986, 0xfbef, 0xfa8a, 0xf945, 0xfbef, 0xfa28, 0xf945, 0xfc10, 0xfa08, 0xfa8a, 0xfd14, 0xf9e7, 0xf8c3, 0xf8e3, 0xfc10, 0xfc92, 0xf9c7, 0xf965, 0xf904, 0xf924, 0xf8e3, 0xfa69, 0xfb6d, 0xf820, 0xfa49, 0xfcf3, 0xfa8a, 0xa8e3, 0xf8e3, 0xf924, 0xfcb2, 0xfb6d, 0xf9e7, 0xfcd3, 0xfb4d, 0xf9e7, 0xfcf3, 0xfa69, 0xf965, 0xfb0c, 0xf945, 0xf8a2, 0xf9a6, 0xfc92, 0xfc10, 0xf8c3, 0xf8a2, 0xf9a6, 0xf986, 0xf945, 0xfa49, 0xfbef, 0xfa69, 0xfb6d, 0xfc51, 0xfbcf, 0xd904, 0xf904, 0xf8a2, 0xfb6d, 0xfbcf, 0xfaaa, 0xfcb2, 0xfb6d, 0xfacb, 0xfcb2, 0xf924, 0xf9c7, 0xfbef, 0xf986, 0xf8a2, 0xf9c7, 0xfc92, 0xfc30, 0xf8c3, 0xf965, 0xfd14, 0xfcd3, 0xfcd3, 0xfcb2, 0xfb4d, 0xf986, 0xfb0c, 0xfc92, 0xfbef, 0xe0e3, 0xf904, 0xf8a2, 0xfa8a, 0xfc71, 0xfbcf, 0xfbcf, 0xfb8e, 0xfbef, 0xfbef, 0xf882, 0xfa69, 0xfcd3, 0xf9c7, 0xf8a2, 0xf9a6, 0xfc92, 0xfc10, 0xf945, 0xf8e3, 0xf945, 0xf945, 0xf8e3, 0xfb8e, 0xfbcf, 0xf820, 0xfa8a, 0xfcb2, 0xfbae, 0xd8e3, 0xf904, 0xf8c3, 0xf9c7, 0xfc92, 0xfc92, 0xfa8a, 0xfb6d, 0xfcb2, 0xfb0c, 0xf861, 0xfa8a, 0xfcd3, 0xf9c7, 0xf8a2, 0xf9c7, 0xfc92, 0xfc10, 0xf945, 0xf8e3, 0xf9a6, 0xf9a6, 0xf945, 0xfb8e, 0xfbcf, 0xf861, 0xfaaa, 0xfcb2, 0xfbcf, 0xd8e3, 0xf904, 0xf8e3, 0xf904, 0xfc51, 0xfcb2, 0xf986, 0xfb2c, 0xfcf3, 0xfa8a, 0xf841, 0xfaaa, 0xfd14, 0xf9e7, 0xf882, 0xf9c7, 0xfcb2, 0xfc10, 0xf8a2, 0xf8e3, 0xfcf3, 0xfcd3, 0xfc92, 0xfc92, 0xfb2c, 0xf820, 0xfa8a, 0xfcb2, 0xfbef, 0xe0e3, 0xf904, 0xf904, 0xf8c3, 0xfaeb, 0xfbae, 0xf8e3, 0xfa49, 0xfbef, 0xf986, 0xf8a2, 0xfa28, 0xfbef, 0xf9a6, 0xf882, 0xfa49, 0xfcb2, 0xfbcf, 0xf9a6, 0xf9e7, 0xfc10, 0xfbef, 0xfbef, 0xfc51, 0xfb6d, 0xf924, 0xfaeb, 0xfcb2, 0xfb2c, 0xc8c3, 0xf8e3, 0xf904, 0xf904, 0xf8c3, 0xf8c3, 0xf904, 0xf8e3, 0xf8c3, 0xf8e3, 0xf904, 0xf8e3, 0xf8c3, 0xf8e3, 0xf8a2, 0xfbae, 0xfc51, 0xfbef, 0xfc51, 0xfc30, 0xfbef, 0xfbef, 0xfbef, 0xfbef, 0xfbef, 0xfc51, 0xfc92, 0xfc92, 0xf904, 0x58e3, 0x7986, 0xf8a2, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xfb2c, 0xfcd3, 0xfc51, 0xfc51, 0xfc71, 0xfc51, 0xfc51, 0xfc51, 0xfc30, 0xfc30, 0xfc51, 0xfc71, 0xfbcf, 0xf965, 0x98a2, 0x0000, 0x0000, 0x58e3, 0xd124, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf945, 0xfa28, 0xf9c7, 0xf9a6, 0xf9c7, 0xf9c7, 0xf9c7, 0xf9c7, 0xf9c7, 0xf965, 0xf9a6, 0xf9c7, 0xf9c7, 0xd904, 0x7882, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2861, 0x3061, 0x2841, 0x7104, 0xf904, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8c3, 0xf8a2, 0xf8c3, 0xf8c3, 0xf8c3, 0xf8c3, 0xf8c3, 0xf8a2, 0x98a2, 0x2841, 0x3041, 0x3041, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x5904, 0xf145, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0x8145, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1861, 0x98e3, 0xf924, 0xf8e3, 0xf904, 0xf904, 0xf904, 0xf904, 0xf8e3, 0xf904, 0xb945, 0x38a2, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1841, 0x68e3, 0xa124, 0xc0e3, 0xc0c3, 0xa945, 0x7924, 0x3041, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000};// 16 31 | static const tPicture wifi2sr = { image_data_wifi2sr, 29, 20, 580, 16, RLE_no}; 32 | 33 | #endif 34 | 35 | -------------------------------------------------------------------------------- /_includes/SSD_1331_registers.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1331_REG_H_ 2 | #define _SSD_1331_REG_H_ 3 | /*========================================================================================= 4 | Part of SSD_13XX library 5 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 6 | 7 | SSD_13XX Library is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | SSD_13XX Library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Foobar. If not, see . 19 | --------------------------------------------------------------------------------------- 20 | SSD1331 Registers set 21 | ===========================================================================================*/ 22 | #define _SSD_USECMDASDATA 1 23 | //registers----------------------- 24 | static const uint8_t CMD_NOP = 0xE3;//SSD1332 25 | static const uint8_t CMD_DRAWLINE = 0x21;//SSD1332 26 | static const uint8_t CMD_DRAWRECT = 0x22;//SSD1332 27 | static const uint8_t CMD_DRAWCOPY = 0x23;//SSD1332 28 | static const uint8_t CMD_DIMWINDOW = 0x24;//SSD1332 29 | static const uint8_t CMD_CLRWINDOW = 0x25;//SSD1332 30 | static const uint8_t CMD_FILL = 0x26;//SSD1332 31 | static const uint8_t CMD_SCROLL_OFF = 0x2E;// 32 | static const uint8_t CMD_SCROLL_ON = 0x2F;// 33 | static const uint8_t CMD_SCROLL_SET = 0x2F; 34 | static const uint8_t CMD_STARTLINE = 0xA1;//SSD1332 35 | static const uint8_t CMD_DISPLAYALLON = 0xA5;//SSD1332 36 | static const uint8_t CMD_DISPLAYALLOFF = 0xA6;//SSD1332 37 | static const uint8_t CMD_DINVOF = 0x20; 38 | static const uint8_t CMD_PHASEPERIOD = 0x12;//SSD1332 39 | static const uint8_t CMD_CONTRASTA = 0x81;//SSD1332 40 | static const uint8_t CMD_CONTRASTB = 0x82;//SSD1332 41 | static const uint8_t CMD_CONTRASTC = 0x83;//SSD1332 42 | static const uint8_t CMD_DIMMODESET = 0xAB; 43 | static const uint8_t CMD_MASTERCURRENT = 0x87;//SSD1332 44 | static const uint8_t CMD_SETREMAP = 0xA0;//SSD1332 45 | static const uint8_t CMD_DISPLAYOFFSET = 0xA2;//SSD1332 46 | static const uint8_t CMD_SETMULTIPLEX = 0xA8;//SSD1332 47 | static const uint8_t CMD_SETMASTER = 0xAD;//SSD1332 48 | static const uint8_t CMD_POWERMODE = 0xB0;//SSD1332 49 | static const uint8_t CMD_PRECHARGE = 0xB1;//SSD1332 50 | static const uint8_t CMD_CLOCKDIV = 0xB3;//SSD1332 51 | static const uint8_t CMD_GRAYSCALE = 0xB8;//SSD1332 52 | static const uint8_t CMD_PRECHARGEA = 0x8A;//SSD1332 53 | static const uint8_t CMD_PRECHARGEB = 0x8B;//SSD1332 54 | static const uint8_t CMD_PRECHARGEC = 0x8C;//SSD1332 55 | static const uint8_t CMD_LINEARGRAY = 0xB9;//SSD1332 56 | static const uint8_t CMD_PRECHARGELEVEL = 0xBB;//SSD1332 57 | static const uint8_t CMD_VCOMH = 0xBE;//SSD1332 58 | static const uint8_t CMD_VPACOLORLVL = 0xBB;//SSD1332 59 | static const uint8_t CMD_VPBCOLORLVL = 0xBC;//SSD1332 60 | static const uint8_t CMD_VPCCOLORLVL = 0xBD;//SSD1332 61 | static const uint8_t CMD_CMDLOCK = 0xFD; 62 | static const uint8_t CMD_NORMALDISPLAY = 0xA4;//SSD1332 63 | static const uint8_t CMD_INVERTDISPLAY = 0xA7;//SSD1332 64 | static const uint8_t CMD_DISPLAYOFF = 0xAE;//SSD1332 65 | static const uint8_t CMD_DISPLAYDIM = 0xAC; 66 | static const uint8_t CMD_DISPLAYON = 0xAF;//SSD1332 67 | static const uint8_t CMD_SETCOLUMN = 0x15;//SSD1332 68 | static const uint8_t CMD_SETROW = 0x75;//SSD1332 69 | 70 | 71 | 72 | /* 73 | 7,6) 00:256colors 01:65K 10:65k2 74 | 5) 0:disable com split 1:enable com split 75 | 4) 0:scan from COM0 to COM(n-1) 1:scan from COM(n-1) to COM0 76 | 3) 0:disable Left/Right swap 1:enable Left/Right swap MH? 77 | 2) 0:RGB 1:GBR RGB 78 | 1) 0:RAM col 0->95 1:RAM col 95->0 79 | 0) 0:Hor Address increment 1:Ver Address increment 80 | */ 81 | 82 | #endif -------------------------------------------------------------------------------- /_includes/SSD_1332_registers.h: -------------------------------------------------------------------------------- 1 | #ifndef _SSD_1332_REG_H_ 2 | #define _SSD_1332_REG_H_ 3 | /*========================================================================================= 4 | Part of SSD_13XX library 5 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 6 | 7 | SSD_13XX Library is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | SSD_13XX Library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with Foobar. If not, see . 19 | --------------------------------------------------------------------------------------- 20 | SSD1332 Registers set 21 | ===========================================================================================*/ 22 | #define _SSD_USECMDASDATA 1 23 | //registers----------------------- 24 | static const uint8_t CMD_NOP = 0xE3;//SSD1332 25 | static const uint8_t CMD_DRAWLINE = 0x21;//SSD1332 26 | static const uint8_t CMD_DRAWRECT = 0x22;//SSD1332 27 | static const uint8_t CMD_DRAWCOPY = 0x23;//SSD1332 28 | static const uint8_t CMD_DIMWINDOW = 0x24;//SSD1332 29 | static const uint8_t CMD_CLRWINDOW = 0x25;//SSD1332 30 | static const uint8_t CMD_FILL = 0x26;//SSD1332 31 | static const uint8_t CMD_SCROLL_OFF = 0x2E;// 32 | static const uint8_t CMD_SCROLL_ON = 0x2F;// 33 | static const uint8_t CMD_SCROLL_SET = 0x2F; 34 | static const uint8_t CMD_STARTLINE = 0xA1;//SSD1332 35 | static const uint8_t CMD_DISPLAYALLON = 0xA5;//SSD1332 36 | static const uint8_t CMD_DISPLAYALLOFF = 0xA6;//SSD1332 37 | //static const uint8_t CMD_DINVOF = 0x20; 38 | static const uint8_t CMD_PHASEPERIOD = 0x12;//SSD1332 39 | static const uint8_t CMD_CONTRASTA = 0x81;//SSD1332 40 | static const uint8_t CMD_CONTRASTB = 0x82;//SSD1332 41 | static const uint8_t CMD_CONTRASTC = 0x83;//SSD1332 42 | //static const uint8_t CMD_DIMMODESET = 0xAB; 43 | static const uint8_t CMD_MASTERCURRENT = 0x87;//SSD1332 44 | static const uint8_t CMD_SETREMAP = 0xA0;//SSD1332 45 | static const uint8_t CMD_DISPLAYOFFSET = 0xA2;//SSD1332 46 | static const uint8_t CMD_SETMULTIPLEX = 0xA8;//SSD1332 47 | static const uint8_t CMD_SETMASTER = 0xAD;//SSD1332 48 | static const uint8_t CMD_POWERMODE = 0xB0;//SSD1332 49 | //static const uint8_t CMD_PRECHARGE = 0xB1;//SSD1332 50 | static const uint8_t CMD_CLOCKDIV = 0xB3;//SSD1332 51 | static const uint8_t CMD_GRAYSCALE = 0xB8;//SSD1332 52 | //static const uint8_t CMD_PRECHARGEA = 0x8A;//SSD1332 53 | //static const uint8_t CMD_PRECHARGEB = 0x8B;//SSD1332 54 | //static const uint8_t CMD_PRECHARGEC = 0x8C;//SSD1332 55 | static const uint8_t CMD_LINEARGRAY = 0xB9;//SSD1332 56 | //static const uint8_t CMD_PRECHARGELEVEL = 0xBB;//SSD1332 57 | static const uint8_t CMD_VCOMH = 0xBE;//SSD1332 58 | static const uint8_t CMD_VPACOLORLVL = 0xBB;//SSD1332 59 | static const uint8_t CMD_VPBCOLORLVL = 0xBC;//SSD1332 60 | static const uint8_t CMD_VPCCOLORLVL = 0xBD;//SSD1332 61 | //static const uint8_t CMD_CMDLOCK = 0xFD; 62 | static const uint8_t CMD_NORMALDISPLAY = 0xA4;//SSD1332 63 | static const uint8_t CMD_INVERTDISPLAY = 0xA7;//SSD1332 64 | static const uint8_t CMD_DISPLAYOFF = 0xAE;//SSD1332 65 | static const uint8_t CMD_DISPLAYDIM = 0xAC; 66 | static const uint8_t CMD_DISPLAYON = 0xAF;//SSD1332 67 | static const uint8_t CMD_SETCOLUMN = 0x15;//SSD1332 68 | static const uint8_t CMD_SETROW = 0x75;//SSD1332 69 | 70 | 71 | 72 | /* The remap command 73 | 1332 74 | 7,6) 00:256colors 01:65K 75 | 5) 0:disable com split 1:enable com split 76 | 4) 0:scan from COM0 to COM(n-1) 1:scan from COM(n-1) to COM0 77 | 3) reserved <-- Argh! 78 | 2) reserved 79 | 1) 0:RAM col 0->95 1:RAM col 95->0 80 | 0) 0:Hor Address increment 1:Ver Address increment 81 | */ 82 | 83 | #endif -------------------------------------------------------------------------------- /_includes/SSD_1351_registers.h: -------------------------------------------------------------------------------- 1 | /*========================================================================================= 2 | Part of SSD_13XX library 3 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 4 | 5 | SSD_13XX Library is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | SSD_13XX Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Foobar. If not, see . 17 | --------------------------------------------------------------------------------------- 18 | SSD1351 Registers set 19 | ===========================================================================================*/ 20 | #ifndef _SSD_1351_REG_H_ 21 | #define _SSD_1351_REG_H_ 22 | 23 | //registers----------------------- 24 | static const uint8_t CMD_NOP = 0xAD;//B0//D1//E3 25 | static const uint8_t CMD_WRITERAM = 0x5C; 26 | static const uint8_t CMD_READRAM = 0x5D; 27 | static const uint8_t CMD_FUNCTIONSELECT = 0xAB; 28 | static const uint8_t CMD_DISPLAYENHANCE = 0xB2; 29 | static const uint8_t CMD_SETVSL = 0xB4; 30 | static const uint8_t CMD_SETGPIO = 0xB5; 31 | static const uint8_t CMD_PRECHARGE2 = 0xB6; 32 | static const uint8_t CMD_USELUT = 0xB9; 33 | static const uint8_t CMD_CONTRASTABC = 0xC1; 34 | static const uint8_t CMD_MASTERCURRENT = 0xC7; 35 | static const uint8_t CMD_MUXRATIO = 0xCA; 36 | static const uint8_t CMD_CMDLOCK = 0xFD; 37 | static const uint8_t CMD_HORIZSCROLL = 0x96; 38 | static const uint8_t CMD_SCROLL_OFF = 0x9E;//SSD1351 39 | static const uint8_t CMD_SCROLL_ON = 0x9F;//SSD1351 40 | static const uint8_t CMD_STARTLINE = 0xA1;//SSD1351 41 | static const uint8_t CMD_DISPLAYALLON = 0xA5;//SSD1351 42 | static const uint8_t CMD_DISPLAYALLOFF = 0xA6;//SSD1351 43 | //static const uint8_t CMD_DINVOF = 0x20;//Display Inversion OFF 44 | //static const uint8_t CMD_PHASEPERIOD = 0x12; 45 | //static const uint8_t CMD_CONTRASTA = 0x81; 46 | //static const uint8_t CMD_CONTRASTB = 0x82; 47 | //static const uint8_t CMD_CONTRASTC = 0x83; 48 | //static const uint8_t CMD_MASTERCURRENT = 0x87; 49 | static const uint8_t CMD_SETREMAP = 0xA0;//SSD1351 50 | static const uint8_t CMD_DISPLAYOFFSET = 0xA2;//SSD1351 51 | //static const uint8_t CMD_SETMULTIPLEX = 0xA8; 52 | //static const uint8_t CMD_SETMASTER = 0xAD; 53 | //static const uint8_t CMD_POWERMODE = 0xB0; 54 | static const uint8_t CMD_PRECHARGE = 0xB1;//SSD1351 55 | static const uint8_t CMD_CLOCKDIV = 0xB3;//SSD1351 56 | static const uint8_t CMD_GRAYSCALE = 0xB8; 57 | static const uint8_t CMD_PRECHARGELEVEL = 0xBB;//SSD1351 58 | static const uint8_t CMD_VCOMH = 0xBE;//SSD1351 59 | static const uint8_t CMD_NORMALDISPLAY = 0xA6;//SSD1351 60 | static const uint8_t CMD_INVERTDISPLAY = 0xA7;//SSD1351 61 | static const uint8_t CMD_DISPLAYOFF = 0xAE;//SSD1351 62 | static const uint8_t CMD_DISPLAYON = 0xAF;//SSD1351 63 | static const uint8_t CMD_SETCOLUMN = 0x15;//SSD1351 64 | static const uint8_t CMD_SETROW = 0x75;//SSD1351 65 | static const uint8_t CMD_SLEEPON = 0xAE;//SSD1351 66 | static const uint8_t CMD_SLEEPOFF = 0xAF;//SSD1351 67 | //static const uint8_t CMD_VSSTADRS = 0x37;//Vertical Scrolling Start address _CMD_VSCLLSA 68 | 69 | /* 70 | ---------------------------------------------------------------------------------- 71 | REMAP 01 1 1 0 1 0 0 72 | 7,6) 00:256colors *01:65K 10:256k 73 | 5) 0:disable com split *1:enable com split 74 | 4) 0:Scan from up to down 1:Scan from bottom to up 75 | 3) reserved 76 | 2) 0:RGB 1:GBR RGB 77 | 1) 0:RAM Column 0 ~ 127 maps to Col0~Col127 1:RAM Column 0 ~ 127 maps to Col127~Col0 (Column Address Remap) 78 | 0) 0:Hor Address increment 1:Ver Address increment 79 | */ 80 | 81 | 82 | #endif -------------------------------------------------------------------------------- /_includes/_common_16bit_colors.h: -------------------------------------------------------------------------------- 1 | #ifndef _COMMON_16BIT_COLORS_H_ 2 | #define _COMMON_16BIT_COLORS_H_ 3 | /* 4 | Many libraries uses 16bit colors so I decided to share this table 5 | between libraries and will be included just once. 6 | NOTE: This version include the ILI9341_t3 colors for compatibility... 7 | */ 8 | 9 | 10 | static const uint16_t BLACK = 0x0000; 11 | static const uint16_t WHITE = 0xFFFF; 12 | static const uint16_t NAVY = 0x000F; 13 | static const uint16_t DARKGREEN = 0x03E0; 14 | static const uint16_t DARKCYAN = 0x03EF; 15 | static const uint16_t MAROON = 0x7800; 16 | static const uint16_t PURPLE = 0x780F; 17 | static const uint16_t ORANGE = 0xFD20; 18 | static const uint16_t PINK = 0xF81F; 19 | static const uint16_t OLIVE = 0x7BE0; 20 | static const uint16_t BLUE = 0x001F; 21 | static const uint16_t RED = 0xF800; 22 | static const uint16_t GREEN = 0x07E0; 23 | static const uint16_t CYAN = 0x07FF; 24 | static const uint16_t MAGENTA = 0xF81F; 25 | static const uint16_t YELLOW = 0xFFE0; 26 | static const uint16_t BRIGHT_RED = 0xF810; 27 | static const uint16_t LIGHT_GREY = 0xC618;//0x8410; 28 | static const uint16_t DARK_GREY = 0x7BEF;//0x4208; 29 | static const uint16_t GREENYELLOW = 0xAFE5; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /_includes/_cpuCommons.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMMON_CPU_IDENT_H 2 | #define __COMMON_CPU_IDENT_H 3 | #include 4 | //this are for the LCD Image Converter as workaround 5 | #define RLE_no (0) 6 | #define RLE_yes (1) 7 | #define RLE_proportional (0) 8 | #define RLE_monospaced (1) 9 | /* 10 | _SPI_MULTITRANSFER 11 | Spi burst multy byte transfer support (experimental) 12 | */ 13 | 14 | #if defined(ESP8266) 15 | #define _smCharType uint8_t 16 | #if defined(SPI_HAS_TRANSACTION) 17 | static const uint32_t _common_max_SPI_speed = 7999999; 18 | #endif 19 | #define _SPI_MULTITRANSFER //enable burst multy byte transfer 20 | #elif defined(__AVR__) 21 | #include 22 | #include 23 | #define _FORCE_PROGMEM__ 24 | #define _smCharType unsigned char //uint8_t 25 | #if defined(SPI_HAS_TRANSACTION) 26 | static const uint32_t _common_max_SPI_speed = 8000000; 27 | #endif 28 | #define _SPI_MULTITRANSFER //enable burst multy byte transfer 29 | #elif defined(__SAM3X8E__) 30 | #include 31 | //#define _FORCE_PROGMEM__ 32 | //#define PROGMEM 33 | //#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) 34 | //#define pgm_read_word(addr) (*(const unsigned short *)(addr)) 35 | //typedef unsigned char prog_uchar; 36 | #define _smCharType unsigned char 37 | #if defined(SPI_HAS_TRANSACTION) 38 | const uint32_t _common_max_SPI_speed = 24000000; 39 | #endif 40 | #define _SPI_MULTITRANSFER //enable burst multy byte transfer 41 | //Teensy LC, Teensy 3.0, Teensy 3.1, Teensy xx, superTeensy 42 | #elif defined(__MKL26Z64__) || defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) 43 | //#include 44 | //#define _FORCE_PROGMEM__ 45 | #define _smCharType unsigned char 46 | static const uint32_t _common_max_SPI_speed = 30000000; 47 | #if !defined(__MKL26Z64__) 48 | #define _SPI_MULTITRANSFER //enable burst multy byte transfer 49 | #endif 50 | #else//all the rest 51 | #define _smCharType uint8_t 52 | #if defined(SPI_HAS_TRANSACTION) 53 | static const uint32_t _common_max_SPI_speed = 8000000; 54 | #endif 55 | #endif 56 | 57 | #if defined(_FORCE_PROGMEM__) 58 | template T PROGMEM_read (const T * sce) { static T temp; memcpy_P (&temp, sce, sizeof (T)); return temp; } 59 | #endif 60 | #endif 61 | -------------------------------------------------------------------------------- /_includes/sumotoy_fontDescription.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sumotoy universal font Description structure version 2.4 3 | */ 4 | 5 | #ifndef __SUMOTOY_FONTD_H 6 | #define __SUMOTOY_FONTD_H 7 | #include 8 | 9 | #if defined(_FORCE_PROGMEM__) 10 | typedef struct PROGMEM {//__PRGMTAG_ 11 | const _smCharType *data; 12 | uint8_t image_width; 13 | int image_datalen; 14 | } tImage; 15 | 16 | typedef struct { 17 | _smCharType char_code; 18 | const tImage *image; 19 | } tChar; 20 | #else 21 | typedef struct { 22 | const _smCharType *data; 23 | uint8_t image_width; 24 | int image_datalen; 25 | } tImage; 26 | 27 | typedef struct { 28 | _smCharType char_code; 29 | const tImage *image; 30 | } tChar; 31 | #endif 32 | 33 | typedef struct { 34 | uint8_t length; 35 | const tChar *chars; 36 | boolean font_widthType; 37 | uint8_t font_height; 38 | uint8_t font_descent; 39 | boolean rle; 40 | uint8_t remap_code; 41 | } tFont; 42 | 43 | 44 | #endif 45 | 46 | 47 | -------------------------------------------------------------------------------- /_includes/sumotoy_iconDescription.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sumotoy universal Icon Description structure version 1.3.1 3 | */ 4 | 5 | #ifndef __SUMOTOY_ICON_H 6 | #define __SUMOTOY_ICON_H 7 | 8 | #include 9 | 10 | #if defined(_FORCE_PROGMEM__) 11 | typedef struct PROGMEM { 12 | const _smCharType *data;//B&W 13 | unsigned char image_width; 14 | unsigned char image_height; 15 | uint16_t image_datalen; 16 | unsigned char image_comp; 17 | } tIcon; 18 | #else 19 | typedef struct { 20 | const _smCharType *data;//B&W 21 | uint8_t image_width; 22 | uint8_t image_height; 23 | uint16_t image_datalen; 24 | boolean image_comp; 25 | } tIcon; 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /_includes/sumotoy_imageDescription.h: -------------------------------------------------------------------------------- 1 | /* 2 | Sumotoy universal Image Description structure version 1.3 3 | */ 4 | 5 | #ifndef __SUMOTOY_IMAGE_H 6 | #define __SUMOTOY_IMAGE_H 7 | 8 | #include 9 | 10 | #if defined(_FORCE_PROGMEM__) 11 | typedef struct PROGMEM { 12 | const uint16_t *data;//R5G6B5 13 | uint8_t image_width; 14 | uint8_t image_height; 15 | uint16_t image_datalen; 16 | uint8_t image_depth; 17 | boolean image_comp; 18 | } tPicture; 19 | #else 20 | typedef struct { 21 | const uint16_t *data;//R5G6B5 22 | uint8_t image_width; 23 | uint8_t image_height; 24 | uint16_t image_datalen; 25 | uint8_t image_depth; 26 | boolean image_comp; 27 | } tPicture; 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /_settings/SSD_13XX_settings.h: -------------------------------------------------------------------------------- 1 | /*========================================================================================= 2 | Part of SSD_13XX library 3 | Copyright (c) 2014/2015/2016, .S.U.M.O.T.O.Y., coded by Max MC Costa. 4 | 5 | SSD_13XX Library is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | SSD_13XX Library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with Foobar. If not, see . 17 | --------------------------------------------------------------------------------------- 18 | User settings 19 | ===========================================================================================*/ 20 | #ifndef _SSD_13XX_USETT_H_ 21 | #define _SSD_13XX_USETT_H_ 22 | /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 23 | USER SETTINGS 24 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 25 | /*-------------------------------------------------------------------------------- 26 | Here you choose the display file for your display. 27 | You must select just ONE and comment the others. 28 | Default: #include "../_display/SSD_1331_96x64.h" 29 | (uncomment just one below...) 30 | ----------------------------------------------------------------------------------*/ 31 | #include "../_display/SSD_1331_96x64.h" 32 | //#include "../_display/SSD_1331_REDPCB.h" 33 | //#include "../_display/SSD_1332_96x64.h" 34 | //#include "../_display/SSD_1351_128x128.h" 35 | /*-------------------------------------------------------------------------------- 36 | - Size Reducing (decrease slight performances) - 37 | Ignored for Teensy 3.x, DUE 38 | Small CPU like UNO have very small resources and code optimizations uses lot of. 39 | Uncomment _SSD_SIZEOPTIMIZER will decrease space needed by code but some performance 40 | will suffer a bit, however it can be usefult in many cases! 41 | Default:uncommented (automatically enabled for some CPU) 42 | ----------------------------------------------------------------------------------*/ 43 | #if !defined(__MK20DX128__) && !defined(__MK20DX256__) && !defined(__SAM3X8E__) && !defined(__MK64FX512__) && !defined(__MK66FX1M0__)// && !defined(ESP8266) 44 | #define _SSD_SIZEOPTIMIZER 45 | #endif 46 | /*-------------------------------------------------------------------------------- 47 | - Default Font - 48 | To change default font, you must: 49 | _SSD_DEF_FONT_PATH "the complete path of the font" (default:"_fonts/defaultFont.c") 50 | _SSD_DEF_FONT_NAME the_unique_name_of_the_font (default:defaultFont) 51 | To avoid any font, just uncomment the 2 defines and a blank font will be loaded (almost 0 resources) 52 | Default: (defaultFont = arial_2x) 53 | #define _SSD_DEF_FONT_PATH "_fonts/defaultFont.c" 54 | #define _SSD_DEF_FONT_NAME defaultFont 55 | ----------------------------------------------------------------------------------*/ 56 | #define _SSD_DEF_FONT_PATH "_fonts/defaultFont.c" 57 | #define _SSD_DEF_FONT_NAME defaultFont 58 | /*-------------------------------------------------------------------------------- 59 | - Default Display Rotation - 60 | This parameter can be changed in your code but here you can force orientation 61 | Default:0 62 | ----------------------------------------------------------------------------------*/ 63 | #define _SSD_DEF_ROTATION 0 64 | /*-------------------------------------------------------------------------------- 65 | - Default Background Color & Default Foreground Color - 66 | When display turns on, it will set the defaul background and foreground. 67 | the default background and foreground affects several other function 68 | when you forget to assign color, for example clearScreen() will clear screen to black 69 | Assigning setBackground(0xF800), red, will result in a red screen when cleared. 70 | Default:BLACK & WHITE 71 | ----------------------------------------------------------------------------------*/ 72 | #define _SSD_DEF_BACKGROUND BLACK 73 | #define _SSD_DEF_FOREGROUND WHITE 74 | /*-------------------------------------------------------------------------------- 75 | - Teensy LC Fast CS Port option - 76 | Teensy LC optional Direct Port vs digitalWriteFast methods 77 | If you have any issues ONLY with Teensy LC and other SPI devices that share 78 | the same SPI lines try to comment the line nelow... 79 | The library default uses Direct Port Manipulation (that it's slight faster) 80 | Default:uncommented 81 | ----------------------------------------------------------------------------------*/ 82 | #if defined(__MKL26Z64__) 83 | #define _TEENSYLC_FASTPORT 84 | #endif 85 | /*-------------------------------------------------------------------------------- 86 | - ESP8266 Faster SPI - 87 | This force library to use the SPI.write method instead the legacy SPI.transfer. 88 | As result is much faster. (Thanks Reaper7) 89 | Default:uncommented 90 | ----------------------------------------------------------------------------------*/ 91 | #if defined(ESP8266) 92 | #define _ESP8266_SPIFAST 93 | #endif 94 | /*-------------------------------------------------------------------------------- 95 | - ESP8266 Compatibility mode - 96 | This force library to use an alternative way to trigger ESP8266 GPIO, if you uncomment 97 | the line it will use the standard digitaWrite wich is slow, this help debugging. 98 | NOTE: uncomment this, code is MUCH slower! 99 | Default:commented 100 | ----------------------------------------------------------------------------------*/ 101 | #if defined(ESP8266) 102 | //#define _ESP8266_STANDARDMODE 103 | #endif 104 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 105 | /*--------------------------------------------------------------------------------- 106 | END OF USER SETTINGS 107 | ----------------------------------------------------------------------------------*/ 108 | static const uint32_t SSD_CGRAM = SSD_WIDTH * SSD_HEIGHT; 109 | #endif 110 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/ConverterPreset/sumotoy_font.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sumotoy_font 4 | 5 | 0 6 | 0 7 | 144 8 | 0 9 | 0 10 | 1 11 | 0 12 | 1 13 | 0 14 | 15 | 16 | 17 | 00000001 18 | ffffffff 19 | 00000000 20 | 000000ff 21 | 22 | 23 | ff000000 24 | 0 25 | 0 26 | 27 | 28 | 00000001 29 | 0 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 1 39 | 0 40 | 0 41 | 0 42 | 0 43 | 2 44 | 0x 45 | 46 | , 47 | 48 | 49 | 0 50 | 1 51 | latin1 52 | 53 | 54 | C:/lcd-image-converter-beta/sumotoy_icon_1.3.tmpl 55 | C:/lcd-image-converter-beta/sumotoy_font_2.4.tmpl 56 | 57 | 58 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/ConverterPreset/sumotoy_icon.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sumotoy_icon 4 | 5 | 0 6 | 0 7 | 144 8 | 0 9 | 0 10 | 0 11 | 0 12 | 1 13 | 0 14 | 15 | 16 | 17 | 00000001 18 | ffffffff 19 | 00000000 20 | 000000ff 21 | 22 | 23 | ff000000 24 | 0 25 | 0 26 | 27 | 28 | 00000001 29 | 0 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 0 39 | 0 40 | 0 41 | 0 42 | 0 43 | 2 44 | 0x 45 | 46 | , 47 | 48 | 49 | 0 50 | 1 51 | latin1 52 | 53 | 54 | C:/Users/chinatown/Desktop/lcd-image-converter-beta/sumotoy_icon_1.3.tmpl 55 | C:/Users/chinatown/Desktop/lcd-image-converter-beta/sumotoy_font_2.4.tmpl 56 | 57 | 58 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/ConverterPreset/sumotoy_image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | sumotoy_image 4 | 5 | 2 6 | 0 7 | 128 8 | 0 9 | 0 10 | 0 11 | 0 12 | 1 13 | 0 14 | 15 | 16 | 17 | 0000ffff 18 | ffffffff 19 | 00000000 20 | ffffffff 21 | 22 | 23 | ff000000 24 | 0 25 | 0 26 | 27 | 28 | 00f80000 29 | 8 30 | 0 31 | 32 | 33 | 0000fc00 34 | 5 35 | 0 36 | 37 | 38 | 000000f8 39 | 3 40 | 0 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 0 49 | 1 50 | 0 51 | 0 52 | 0 53 | 2 54 | 0x 55 | 56 | , 57 | 58 | 59 | 0 60 | 1 61 | latin1 62 | 63 | 64 | C:/lcd-image-converter-beta/sumotoy_picture_1.3.tmpl 65 | C:/lcd-image-converter-beta/sumotoy_font_2.4.tmpl 66 | 67 | 68 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/FontFiles/akasha_cap.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Akashi 4 | 14 5 | 6 | proportional 7 | false 8 | false 9 | +,-.0123456789:<=>?ABCDEFGHIJKLMNOPQRSTUVWXY 10 | C:/ArduinoSketches/libraries/TFT_ILI9163C/_utility/for_LCD_Font_Converter/FontFiles/akasha_cap.c 11 | 12 | 13 | iVBORw0KGgoAAAANSUhEUgAAAAcAAAALCAIAAAA88gD/AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAFElEQVQImWP8//8/AwZgwhQaNqIA2KYDE68gAPwAAAAASUVORK5CYII= 14 | 15 | 16 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAM0lEQVQYlWP8//8/AzbAhFUURYKRkZGRkZGwDgasdvz//x+nDka4DogFcC4ROnA6l1gJAJkTEglXrJVrAAAAAElFTkSuQmCC 17 | 18 | 19 | iVBORw0KGgoAAAANSUhEUgAAAAMAAAALCAIAAAA1GaCFAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAH0lEQVQImWP8//8/AwMDAwMDEwMMUMKCgv///2OTBQCJdQYO7pJh/wAAAABJRU5ErkJggg== 20 | 21 | 22 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAIUlEQVQYlWP8//8/AzbAhFWUuhIMWC3///8/Th2MdHAuAJYrDAfg2myOAAAAAElFTkSuQmCC 23 | 24 | 25 | iVBORw0KGgoAAAANSUhEUgAAAAMAAAALCAIAAAA1GaCFAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAIklEQVQImWP8//8/AwMDAwMDEwMMUMKCgv///yPEGOF2AAChUwkKsDeplwAAAABJRU5ErkJggg== 26 | 27 | 28 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALElEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NNHbzmcgID/GJF9hgYAMGsMC3x71T8AAAAASUVORK5CYII= 29 | 30 | 31 | iVBORw0KGgoAAAANSUhEUgAAAAQAAAALCAIAAADXxbv8AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAIElEQVQImWNggIH///8zMSABpv///yM4KDJU5TAi2wMACT8JC3RpRkcAAAAASUVORK5CYII= 32 | 33 | 34 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAMklEQVQYlWNgwAH+///PhEuOgYGB5f///2hCjIyMEAY+fTgBAfsY4aow5WhiH1abIAAAxugSArBiLzQAAAAASUVORK5CYII= 35 | 36 | 37 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANklEQVQYlWNgwAb+///PhFWCgYGB5f///8h8RkZGCAO3DjSFcEBIB9wmwnZgB/j8wYjmDzgAAN59DxLHF3Q4AAAAAElFTkSuQmCC 38 | 39 | 40 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAMklEQVQYlWNkYGBgYGD4//8/AwwwMjJCRJgYcANayOEEBNzCgux6CID4gQK3MGKaCQcAHNoPDNn6/GUAAAAASUVORK5CYII= 41 | 42 | 43 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALklEQVQYlWNgwAH+///PhEuOgYGBEa4KUw6fPpyAgH0smDYxMjLSzj5GrD6DAADESBICiRtN4gAAAABJRU5ErkJggg== 44 | 45 | 46 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAM0lEQVQYlWNkwAb+///PwMDAhFUOAhiRFaIBfPpwgv///+PTx4JpHyMjI+3sY8TqMwgAALyFEgN29HIbAAAAAElFTkSuQmCC 47 | 48 | 49 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKklEQVQYlWNgwAb+///PhFWCgYGB5f///8h8RkZGCAOnjsEpwYjmDzgAAOBfCRBAQ26dAAAAAElFTkSuQmCC 50 | 51 | 52 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKklEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NOHEwwy+xiRbUIDALgGEgiX2I35AAAAAElFTkSuQmCC 53 | 54 | 55 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAM0lEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NOHTw4nIOQWZFeguYVcMxkxzYQDACJIEgg004VIAAAAAElFTkSuQmCC 56 | 57 | 58 | iVBORw0KGgoAAAANSUhEUgAAAAMAAAALCAIAAAA1GaCFAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAJElEQVQImWP8//8/AwMDAwMDEwMMYGNBwf///xFijFj04lcHAOlaDwHPb7f0AAAAAElFTkSuQmCC 59 | 60 | 61 | iVBORw0KGgoAAAANSUhEUgAAAAcAAAALCAIAAAA88gD/AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAOUlEQVQImZWOQQ4AIAjDNuP/v1wPGjTARU6lJGMGVGZUJWkG2d4AjKTOGvQ+6HMFpBo3Nx380be3C9QqGAJBz8FMAAAAAElFTkSuQmCC 62 | 63 | 64 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAJElEQVQYlWP8//8/AzbAhFUUJ/j//z9OHYy47KCiUTh1kC4BADo+DwHQLfoZAAAAAElFTkSuQmCC 65 | 66 | 67 | iVBORw0KGgoAAAANSUhEUgAAAAcAAAALCAIAAAA88gD/AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAMUlEQVQImWP8//8/AwZgwhRiYGBghLOQNTEiK4FLMCJYjIxwOULmopiA3TYS3ItdFAAFqBf7aAkQ8AAAAABJRU5ErkJggg== 68 | 69 | 70 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAO0lEQVQYlY2OwQoAIAxCNfr/X7ZDEOWY5Gls0yfQSNLobgCmJFuR3EP02e+tD9/p9oBrF88kWZGJlzIXXSwPFrnsxSoAAAAASUVORK5CYII= 71 | 72 | 73 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALElEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NOHTw4nGAC3MCKbhgYAY6EPDRGFL3IAAAAASUVORK5CYII= 74 | 75 | 76 | iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAIAAADJDItPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAOElEQVQYlWNkwAH+///PwMDAhEsaAliQ1UIAIyMjnE1ANyMuCWTzcKrAYjey9QTsJmA4IZfjdyEAydAVBXOEH5IAAAAASUVORK5CYII= 77 | 78 | 79 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAJ0lEQVQYlWNgwAb+///PhFWCgYGBEa4ETQKnDnpIYAd4/YHpAwgAAGQ7DAWbRSCeAAAAAElFTkSuQmCC 80 | 81 | 82 | iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAIAAADJDItPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAM0lEQVQYlWNkwAb+//8PYTBilYarYERTDtXEyAgRZMKlGwIGUpo4j2GVY2BgYETzMRoAAMAJFP81Bwt+AAAAAElFTkSuQmCC 83 | 84 | 85 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAK0lEQVQYlWNgwAb+///PhFWCgYGBEa4ETYKQDmTTidNBgh3YAV5/YJoOAQCZAxH9c6jLSgAAAABJRU5ErkJggg== 86 | 87 | 88 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKklEQVQYlWNgwAb+///PhFWCgYGBEa4ETYKQDmTTidNBgh2kSzBimg4BAP4mDwLFG7IEAAAAAElFTkSuQmCC 89 | 90 | 91 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAOElEQVQYlYWPMQ4AIAwCwfj/L+PQhRqst9KDlEhIArBiVtAPLyZvtxLSJyevZZJ8ePKefPYYPysOHPYVAqX8f9gAAAAASUVORK5CYII= 92 | 93 | 94 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANElEQVQYlWNkYGBgYGD4//8/AwwwMjJCRJgYcANy5XACAvaxwFXBhSDupMAt+OQYkW1CAwCymA8Miv4LmAAAAABJRU5ErkJggg== 95 | 96 | 97 | iVBORw0KGgoAAAANSUhEUgAAAAMAAAALCAIAAAA1GaCFAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAHklEQVQImWNgYGBgYGD4//8/EwMMUJvF+P//fwgLAE11Bg6W8x4aAAAAAElFTkSuQmCC 98 | 99 | 100 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKElEQVQYlWP8//8/AxJgZGRkYGD4//8/EwMOMDglsAN8/mBE8zkcAAAQnAwKliGvdwAAAABJRU5ErkJggg== 101 | 102 | 103 | iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAIAAADJDItPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAQUlEQVQYlWNkYGBgYGD4//8/AwwwMjLCRZgY8AJ0aWSthHUzYhUlVjcLmnKI3TidBlEHV4TTcIgKLNIoQYTMwQQAt+gYDbRDLl8AAAAASUVORK5CYII= 104 | 105 | 106 | iVBORw0KGgoAAAANSUhEUgAAAAgAAAALCAIAAADN+VtyAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAJ0lEQVQYlWNkYGBgYGD4//8/AypgYsABBqcEdvD//3+cOhgx/QwBAApvCQoMWGeKAAAAAElFTkSuQmCC 107 | 108 | 109 | iVBORw0KGgoAAAANSUhEUgAAAA0AAAALCAIAAAAr0JA2AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALElEQVQYlWNgIAL8//+fiRh1DAwMLHAdEAYjIyMml4GBgVjzRpo6RnhQ4QcAS/UMEIYp+xYAAAAASUVORK5CYII= 110 | 111 | 112 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKElEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NM3VOQYkX2GBgCDsgkQhutEtwAAAABJRU5ErkJggg== 113 | 114 | 115 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALElEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NNHbzmcgID/GJF9hgYAMGsMC3x71T8AAAAASUVORK5CYII= 116 | 117 | 118 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANElEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NNHhJnIRhGljxHTLUTpw2smVtMgAAC9QAwRnsSrgQAAAABJRU5ErkJggg== 119 | 120 | 121 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAANUlEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NNHWzlGRka4KwgAAv5jRPYZA8xzEEEAQdIPEZW2SoAAAAAASUVORK5CYII= 122 | 123 | 124 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAOklEQVQYlWNgwAH+///PhEuOgYGBBa4KLsTIyAhh4NOHExCwjxHNPohlEC4+fdjlILrR5VA8g8xBAwDcsxUHY3QdJgAAAABJRU5ErkJggg== 125 | 126 | 127 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAALklEQVQYlWNgwAH+///PhEuOgYGBEa4KUw6fPpyAgH0smDYxMjLSzj5GrD6DAADESBICiRtN4gAAAABJRU5ErkJggg== 128 | 129 | 130 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAK0lEQVQYlWNgwAH+///PhEuOgYGB8f///1AWIyNEOVwOn76hIseI7CE0AABRMwwKnK18wQAAAABJRU5ErkJggg== 131 | 132 | 133 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKUlEQVQYlWNkYGBgYGD4//8/AwwwMjJCRJgYcIOhIocTEPAfI3KIoAEA16cMCuj6i7wAAAAASUVORK5CYII= 134 | 135 | 136 | iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAIAAADJDItPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAO0lEQVQYlY2PQQ4AIAjDOv7/53kgIWoM0iOsCwgAbHMiCQhaIr3MXqrtn/1fX/3VPLMbVB/vx9dwbD9ZW/YYDu4PR4AAAAAASUVORK5CYII= 137 | 138 | 139 | iVBORw0KGgoAAAANSUhEUgAAAA0AAAALCAIAAAAr0JA2AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAKUlEQVQYlWNkYGBgYGD4//8/hMHIyIiVy8RAHBhp6ogCJIQfIzzo8QMAHyQPCkLR3SMAAAAASUVORK5CYII= 140 | 141 | 142 | iVBORw0KGgoAAAANSUhEUgAAAAoAAAALCAIAAADJDItPAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAPklEQVQYlY2PMQ4AMAgChf//mQ6mxtCmlokbQERsSSoPIA3jrR6SZIjkarMYz46Ow23aVMdh2vWF379hm00LxxMs8UBk1jkAAAAASUVORK5CYII= 143 | 144 | 145 | iVBORw0KGgoAAAANSUhEUgAAAAkAAAALCAIAAAAiOzBMAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAOElEQVQYlWNkYGBgYGD4//8/AwwwMjJCRJgYcANayOEEBNzCgux6CID4gYGBgQWZQ4JbGDHNhAMAHm8PEf1uBw4AAAAASUVORK5CYII= 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/FontFiles/arial_x2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sumotoy/SSD_13XX/aed648a0430a1cdd9c4c2512f7971b0dddaeb26f/_utility/for_LCD_Font_Converter/FontFiles/arial_x2.rar -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/font_range.txt: -------------------------------------------------------------------------------- 1 | !"#$%&'()*+,-./0123456789:;<=>?\x0040ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/sumotoy_font_2.4.tmpl: -------------------------------------------------------------------------------- 1 | $(start_block_header) 2 | /******************************************************************************* 3 | 4 | * name: $(doc_name) 5 | * family: $(fnt_family) 6 | * size: $(fnt_size) 7 | * style: $(fnt_style) 8 | * -------------------------------------- 9 | * included characters: $(fnt_string) 10 | * -------------------------------------- 11 | * antialiasing: $(fnt_antialiasing) 12 | * type: $(fnt_width_type) 13 | * encoding: $(fnt_encoding) 14 | * unicode bom: $(fnt_use_bom) 15 | * 16 | * data block size: $(img_data_block_size) bit(s), uint$(img_data_block_size)_t 17 | * RLE compression enabled: $(img_rle) 18 | * conversion type: $(pre_conv_type), $(pre_mono_type) $(pre_mono_edge) 19 | * bits per pixel: $(out_bpp) 20 | * 21 | * preprocess: 22 | * main scan direction: $(pre_scan_main) 23 | * line scan direction: $(pre_scan_sub) 24 | * inverse: $(pre_inverse) 25 | * ------------------------------------------------------------------------------ 26 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 27 | * Font template version: 2.4 28 | * Note: Font height should be fixed and all glyps must have the same height! 29 | * ------------------------------------------------------------------------------ 30 | *******************************************************************************/ 31 | 32 | #if !defined(SUMO_FNT_LIB_$(doc_name)) 33 | #define SUMO_FNT_LIB_$(doc_name) 34 | 35 | #include 36 | $(end_block_header) 37 | 38 | $(start_block_images_table) 39 | const _smCharType image_data_$(doc_name_ws)_0x$(out_char_code)[$(out_blocks_count)] 40 | #if defined(_FORCE_PROGMEM__) 41 | PROGMEM 42 | #endif 43 | = { $(out_image_data) };//character: '$(out_char_text)' 44 | 45 | const tImage $(doc_name_ws)_0x$(out_char_code) 46 | #if defined(_FORCE_PROGMEM__) 47 | PROGMEM 48 | #endif 49 | = { image_data_$(doc_name_ws)_0x$(out_char_code), $(out_image_width), $(out_blocks_count)};//character: '$(out_char_text)' (charW,total bytes) 50 | $(end_block_images_table) 51 | 52 | const tChar $(doc_name_ws)_array[] = { 53 | $(start_block_images_table) 54 | // character: '$(out_char_text)' 55 | {0x$(out_char_code), &$(doc_name_ws)_0x$(out_char_code)}$(out_comma) 56 | $(end_block_images_table) 57 | }; 58 | 59 | //num chars, array, width, height, descent, compression, char remap code 60 | /* 61 | char remap code: 62 | 0:no remap 63 | 1:remap minus to CAPITAL 64 | 2:remap CAPITAL to minus 65 | */ 66 | $(start_block_font_def) 67 | const tFont $(doc_name_ws) = { $(out_images_count), $(doc_name_ws)_array, RLE_$(fnt_width_type), $(out_image_height), 0, RLE_$(img_rle), 0 }; 68 | $(end_block_font_def) 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/sumotoy_icon_1.3.tmpl: -------------------------------------------------------------------------------- 1 | $(start_block_header) 2 | /******************************************************************************* 3 | * name: $(doc_name) 4 | * 5 | * preset name: $(out_preset_name) 6 | * data block size: $(img_data_block_size) bit(s), uint$(img_data_block_size)_t 7 | * RLE compression enabled: $(img_rle) 8 | * conversion type: $(pre_conv_type), $(pre_mono_type) $(pre_mono_edge) 9 | * bits per pixel: $(out_bpp) 10 | * 11 | * preprocess: 12 | * main scan direction: $(pre_scan_main) 13 | * line scan direction: $(pre_scan_sub) 14 | * inverse: $(pre_inverse) 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Icon template version: 1.31 18 | * Note: Used for B&W images as icons 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_ICN_LIB_$(doc_name_ws)) 22 | #define SUMO_ICN_LIB_$(doc_name_ws) 23 | 24 | #include 25 | 26 | $(end_block_header) 27 | 28 | $(start_block_images_table) 29 | 30 | static const _smCharType image_data_$(doc_name_ws)[$(out_blocks_count)] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {$(out_image_data)}; 35 | 36 | static const tIcon $(doc_name_ws) = { image_data_$(doc_name_ws), $(out_image_width), $(out_image_height), $(out_blocks_count), RLE_$(img_rle) }; 37 | 38 | $(end_block_images_table) 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /_utility/for_LCD_Font_Converter/sumotoy_picture_1.3.tmpl: -------------------------------------------------------------------------------- 1 | $(start_block_header) 2 | /******************************************************************************* 3 | * name: $(doc_name) 4 | * 5 | * preset name: $(out_preset_name) 6 | * data block size: $(img_data_block_size) bit(s), uint$(img_data_block_size)_t 7 | * RLE compression enabled: $(img_rle) 8 | * conversion type: $(pre_conv_type), $(pre_mono_type) $(pre_mono_edge) 9 | * bits per pixel: $(out_bpp) 10 | * 11 | * preprocess: 12 | * main scan direction: $(pre_scan_main) 13 | * line scan direction: $(pre_scan_sub) 14 | * inverse: $(pre_inverse) 15 | * ------------------------------------------------------------------------------ 16 | * Created by a custom template of LCD-Image-Converter for .s.u.m.o.t.o.y. 17 | * Image template version: 1.3 18 | * Note: 19 | * ------------------------------------------------------------------------------ 20 | *******************************************************************************/ 21 | #if !defined(SUMO_IMG_LIB_$(doc_name_ws)) 22 | #define SUMO_IMG_LIB_$(doc_name_ws) 23 | 24 | #include 25 | 26 | $(end_block_header) 27 | 28 | $(start_block_images_table) 29 | 30 | static const uint$(img_data_block_size)_t image_data_$(doc_name_ws)[$(out_blocks_count)] 31 | #if defined(_FORCE_PROGMEM__) 32 | PROGMEM 33 | #endif 34 | = {$(out_image_data)}; 35 | 36 | static const tPicture $(doc_name_ws) = { image_data_$(doc_name_ws), $(out_image_width), $(out_image_height), $(out_blocks_count), $(img_data_block_size), RLE_$(img_rle) }; 37 | 38 | $(end_block_images_table) 39 | 40 | #endif 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /examples/Benchmarks_Alternative/Benchmarks_Alternative.ino: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #define DELAY_BETWEEN 500 6 | 7 | 8 | #define __CS 10 9 | #define __DC 9 10 | /* 11 | ESP8266----------------------------------- 12 | Use: 13 | #define __CS 16 //(D0) 14 | #define __DC 5 //(D1) 15 | #define __RST 4 //(D2) 16 | 17 | SCLK:D5 18 | MOSI:D7 19 | */ 20 | 21 | SSD_13XX tft = SSD_13XX(__CS, __DC); 22 | 23 | unsigned long start = 0; 24 | unsigned long t_end = 0; 25 | 26 | void setup() { 27 | Serial.begin(38400); 28 | start = millis (); 29 | while (!Serial && ((millis () - start) <= 5000)) ; 30 | tft.begin(); 31 | } 32 | 33 | uint8_t rot = 0; 34 | void loop(void) { 35 | test(rot); 36 | rot++; 37 | if (rot > 3) rot = 0; 38 | } 39 | -------------------------------------------------------------------------------- /examples/Benchmarks_Alternative/tests.ino: -------------------------------------------------------------------------------- 1 | unsigned long testPixel() { 2 | tft.clearScreen(); 3 | start = micros(); 4 | tft.drawPixel(0, 0, WHITE); 5 | t_end = micros() - start; 6 | return t_end; 7 | } 8 | 9 | unsigned long testPixels() { 10 | int green = 0; 11 | tft.clearScreen(); 12 | start = micros(); 13 | for (int16_t i = 0; i < tft.width(); i++) { 14 | if (green > 255) green = 0; 15 | tft.drawPixel(i, 0, tft.Color565(0, green, 0)); 16 | green++; 17 | } 18 | t_end = micros() - start; 19 | return t_end; 20 | } 21 | 22 | unsigned long testFillScreen() { 23 | tft.clearScreen(); 24 | start = micros(); 25 | tft.fillScreen(0xF800); 26 | t_end = micros() - start; 27 | return t_end; 28 | } 29 | 30 | unsigned long testText() { 31 | tft.clearScreen(); 32 | tft.setTextColor(WHITE); 33 | tft.setTextScale(0); 34 | start = micros(); 35 | tft.println("Hello World!"); 36 | tft.setTextColor(0xFFE0); 37 | tft.setTextScale(1); 38 | tft.println(1234.56); 39 | tft.setTextColor(0xF800); 40 | tft.println(0xFFFF, HEX); 41 | tft.println(); 42 | tft.setTextColor(0x07E0); 43 | tft.setTextScale(3); 44 | tft.println("Hello"); 45 | tft.setTextScale(0); 46 | tft.println("I implore thee, my foonting turlingdromes."); 47 | tft.println("And hooptiously drangle me"); 48 | tft.println("with crinkly bindlewurdles, Or I will rend thee"); 49 | t_end = micros() - start; 50 | return t_end; 51 | } 52 | 53 | unsigned long testLines(uint16_t color) { 54 | int16_t i; 55 | 56 | tft.clearScreen(); 57 | t_end = 0; 58 | start = micros(); 59 | for (i = 0; i < tft.width(); i += 6) tft.drawLine(0, 0, i, tft.height() - 1, color); 60 | for (i = 0; i < tft.height(); i += 6) tft.drawLine(0, 0, tft.width() - 1, i, color); 61 | t_end = micros() - start;//exclude clear screen from count 62 | tft.clearScreen(); 63 | start = micros(); 64 | for (i = 0; i < tft.width(); i += 6) tft.drawLine(tft.width() - 1, 0, i, tft.height() - 1, color); 65 | for (i = 0; i < tft.height(); i += 6) tft.drawLine(tft.width() - 1, 0, 0, i, color); 66 | t_end += micros() - start; 67 | tft.clearScreen(); 68 | start = micros(); 69 | for (i = 0; i < tft.width(); i += 6) tft.drawLine(0, tft.height() - 1, i, 0, color); 70 | for (i = 0; i < tft.height(); i += 6) tft.drawLine(0, tft.height() - 1, tft.width() - 1, i, color); 71 | t_end += micros() - start; 72 | tft.clearScreen(); 73 | start = micros(); 74 | for (i = 0; i < tft.width(); i += 6) tft.drawLine(tft.width() - 1, tft.height() - 1, i, 0, color); 75 | for (i = 0; i < tft.height(); i += 6) tft.drawLine(tft.width() - 1, tft.height() - 1, 0, i, color); 76 | t_end += micros() - start; 77 | return t_end; 78 | } 79 | #if !defined(__AVR_ATmega32U4__) && defined(_ILI9163C_DRAWARC) 80 | unsigned long testArc(uint16_t color) { 81 | uint16_t i, cx = tft.width()/2,cy = tft.height()/2; 82 | tft.clearScreen(); 83 | start = micros(); 84 | for (i = 0; i < 360; i += 5) { 85 | tft.drawArc(cx, cy, 40, 2, 0, i, color); 86 | } 87 | t_end = micros() - start; 88 | return t_end; 89 | } 90 | #endif 91 | 92 | unsigned long testFastLines(uint16_t color1, uint16_t color2) { 93 | int16_t i; 94 | tft.clearScreen(); 95 | start = micros(); 96 | for (i = 0; i < tft.height(); i += 5) tft.drawFastHLine(0, i, tft.width() - 1, color1); 97 | for (i = 0; i < tft.width(); i += 5) tft.drawFastVLine(i, 0, tft.height() - 1, color2); 98 | t_end = micros() - start; 99 | return t_end; 100 | } 101 | 102 | unsigned long testRects(uint16_t color) { 103 | int16_t i; 104 | int16_t i2; 105 | int16_t cx = tft.width() / 2; 106 | int16_t cy = tft.height() / 2; 107 | int16_t n = min(tft.width(), tft.height()); 108 | tft.clearScreen(); 109 | start = micros(); 110 | for (i = 2; i < n; i += 6) { 111 | i2 = i / 2; 112 | tft.drawRect(cx - i2, cy - i2, i, i, color); 113 | } 114 | t_end = micros() - start; 115 | return t_end; 116 | } 117 | 118 | 119 | unsigned long testFilledRects(uint16_t color1, uint16_t color2) { 120 | int n, i, i2, 121 | cx = tft.width() / 2, 122 | cy = tft.height() / 2; 123 | tft.clearScreen(); 124 | n = min(tft.width(), tft.height()); 125 | t_end = 0; 126 | start = micros(); 127 | for (i = 2; i < n; i += 6) { 128 | i2 = i / 2; 129 | tft.fillRect(cx - i2, cy - i2, i, i, color1); 130 | } 131 | t_end = micros() - start; 132 | for (i = 2; i < n; i += 6) { 133 | i2 = i / 2; 134 | tft.drawRect(cx - i2, cy - i2, i, i, color2); 135 | } 136 | return t_end; 137 | } 138 | 139 | 140 | unsigned long testFilledCircles(uint8_t radius, uint16_t color1) { 141 | int16_t x; 142 | int16_t y; 143 | int16_t r2 = radius * 2; 144 | tft.clearScreen(); 145 | start = micros(); 146 | for (x = radius; x < tft.width(); x += r2) { 147 | for (y = radius; y < tft.height(); y += r2) { 148 | tft.fillCircle(x, y, radius, color1); 149 | } 150 | } 151 | t_end = micros() - start; 152 | return t_end; 153 | } 154 | 155 | unsigned long testCircles(uint8_t radius, uint16_t color) { 156 | int16_t x; 157 | int16_t y; 158 | int16_t r2 = radius * 2; 159 | start = micros(); 160 | for (x = 0; x < (tft.width() - radius); x += r2) { 161 | for (y = 0; y < (tft.height() - radius); y += r2) { 162 | tft.drawCircle(x, y, radius, color); 163 | } 164 | } 165 | t_end = micros() - start; 166 | return t_end; 167 | } 168 | 169 | unsigned long testTriangles(uint16_t color) { 170 | uint16_t i; 171 | uint16_t cx = (tft.width() / 2) - 1; 172 | uint16_t cy = (tft.height() / 2) - 1; 173 | uint16_t n = min(cx, cy); 174 | tft.clearScreen(); 175 | start = micros(); 176 | for (i = 0; i < n; i += 5) { 177 | // peak,bottom left,bottom right 178 | tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, color); 179 | } 180 | t_end = micros() - start; 181 | return t_end; 182 | } 183 | 184 | unsigned long testFilledTriangles(uint16_t color1, uint16_t color2) { 185 | uint16_t i; 186 | uint16_t cx = (tft.width() / 2) - 1; 187 | uint16_t cy = (tft.height() / 2) - 1; 188 | uint16_t n = min(cx, cy); 189 | tft.clearScreen(); 190 | t_end = 0; 191 | start = micros(); 192 | for (i = n; i > 10; i -= 5) { 193 | start = micros(); 194 | tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, color1); 195 | t_end += micros() - start; 196 | tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, color2); 197 | } 198 | return t_end; 199 | } 200 | 201 | 202 | 203 | unsigned long testFilledRoundRects() { 204 | uint16_t i, d; 205 | tft.clearScreen(); 206 | if (tft.getRotation() != 1 && tft.getRotation() != 3) { 207 | d = tft.height() - 1; 208 | } else { 209 | d = tft.width() - 1; 210 | } 211 | start = micros(); 212 | for (i = d; i >= 10; i--) { 213 | tft.fillRoundRect(tft.width() / 2 - (i / 2), tft.height() / 2 - (i / 2), i, i, i / 4, tft.htmlTo565(0xFF0000 + i)); 214 | } 215 | t_end = micros() - start; 216 | return t_end; 217 | } 218 | 219 | unsigned long testRoundRects() { 220 | uint16_t i, d; 221 | tft.clearScreen(); 222 | if (tft.getRotation() != 1 && tft.getRotation() != 3) { 223 | d = tft.height() - 1; 224 | } else { 225 | d = tft.width() - 1; 226 | } 227 | start = micros(); 228 | for (i = d; i >= 10; i--) { 229 | tft.drawRoundRect(tft.width() / 2 - (i / 2), tft.height() / 2 - (i / 2), i, i, i / 4, random(0xFFFF)); 230 | } 231 | t_end = micros() - start; 232 | return t_end; 233 | } 234 | 235 | void test(uint8_t rot) { 236 | tft.setRotation(rot); 237 | tft.clearScreen(); 238 | tft.setCursor(CENTER,CENTER); 239 | tft.setTextColor(WHITE); 240 | tft.setTextScale(2); 241 | tft.print("Rot:"); 242 | tft.print(rot); 243 | tft.setCursor(0, 0); 244 | delay(1000); 245 | Serial.print(F("screen:")); 246 | Serial.print(tft.width()); 247 | Serial.print("x"); 248 | Serial.print(tft.height()); 249 | Serial.print(" - rotation:"); 250 | Serial.print(rot); 251 | Serial.println(F("\nBenchmark Time (microseconds)")); 252 | Serial.print(F("Screen fill ")); 253 | Serial.println(testFillScreen()); 254 | delay(DELAY_BETWEEN); 255 | 256 | Serial.print(F("Test Pixel ")); 257 | Serial.println(testPixel()); 258 | delay(DELAY_BETWEEN); 259 | 260 | Serial.print(F("Test Pixels ")); 261 | Serial.println(testPixels()); 262 | delay(DELAY_BETWEEN); 263 | 264 | Serial.print(F("Text ")); 265 | Serial.println(testText()); 266 | delay(DELAY_BETWEEN); 267 | 268 | Serial.print(F("Lines ")); 269 | Serial.println(testLines(0x07FF)); 270 | delay(DELAY_BETWEEN); 271 | 272 | Serial.print(F("Horiz/Vert Lines ")); 273 | Serial.println(testFastLines(0xF800, 0x001F)); 274 | delay(DELAY_BETWEEN); 275 | 276 | Serial.print(F("Rectangles (outline) ")); 277 | Serial.println(testRects(0x07E0)); 278 | delay(DELAY_BETWEEN); 279 | 280 | Serial.print(F("Rectangles (filled) ")); 281 | Serial.println(testFilledRects(0xFFE0, 0xF81F)); 282 | delay(DELAY_BETWEEN); 283 | #if !defined(__AVR_ATmega32U4__) && defined(_ILI9163C_DRAWARC) 284 | Serial.print(F("Arc ")); 285 | Serial.println(testArc(0xF81F)); 286 | delay(DELAY_BETWEEN); 287 | #endif 288 | Serial.print(F("Circles (filled) ")); 289 | Serial.println(testFilledCircles(10, 0xF81F)); 290 | delay(DELAY_BETWEEN); 291 | 292 | Serial.print(F("Circles (outline) ")); 293 | Serial.println(testCircles(10, WHITE)); 294 | delay(DELAY_BETWEEN); 295 | 296 | Serial.print(F("Triangles (outline) ")); 297 | Serial.println(testTriangles(0x07FF)); 298 | delay(DELAY_BETWEEN); 299 | 300 | Serial.print(F("Triangles (filled) ")); 301 | Serial.println(testFilledTriangles(0xF800, 0x07FF)); 302 | delay(DELAY_BETWEEN); 303 | 304 | Serial.print(F("Rounded rects (outline) ")); 305 | Serial.println(testRoundRects()); 306 | delay(DELAY_BETWEEN); 307 | 308 | Serial.print(F("Rounded rects (filled) ")); 309 | Serial.println(testFilledRoundRects()); 310 | delay(DELAY_BETWEEN); 311 | 312 | 313 | Serial.println(F("--------------------------------\n")); 314 | } -------------------------------------------------------------------------------- /examples/Clock_example/Clock_example.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | /* 6 | Teensy3.x and Arduino's 7 | You are using 4 wire SPI here, so: 8 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 9 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 10 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 11 | ESP8266----------------------------------- 12 | Use: 13 | #define __CS 16 //(D0) 14 | #define __DC 5 //(D1) 15 | #define __RST 4 //(D2) 16 | 17 | SCLK:D5 18 | MOSI:D7 19 | */ 20 | #define __CS1 10 21 | #define __DC 9 22 | /* 23 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 24 | Arduino's 8 bit: any 25 | DUE: check arduino site 26 | If you do not use reset, tie it to +3V3 27 | */ 28 | 29 | 30 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 31 | 32 | uint16_t ccenterx, ccentery; //center x,y of the clock 33 | const uint16_t cradius = 32;//radius of the clock 34 | const float scosConst = 0.0174532925; 35 | float sx = 0, sy = 1, mx = 1, my = 0, hx = -1, hy = 0; 36 | float sdeg = 0, mdeg = 0, hdeg = 0; 37 | uint16_t osx, osy, omx, omy, ohx, ohy; 38 | uint16_t x0 = 0, x1 = 0, yy0 = 0, yy1 = 0; 39 | uint32_t targetTime = 0;// for next 1 second timeout 40 | uint8_t hh, mm, ss; //containers for current time 41 | 42 | 43 | void drawClockFace() { 44 | tft.fillCircle(ccenterx, ccentery, cradius-1, BLUE); 45 | tft.fillCircle(ccenterx, ccentery, cradius - 4, BLACK); 46 | // Draw 12 lines 47 | for (int i = 0; i < 360; i += 30) { 48 | sx = cos((i - 90) * scosConst); 49 | sy = sin((i - 90) * scosConst); 50 | x0 = sx * (cradius - 4) + ccenterx; 51 | yy0 = sy * (cradius - 4) + ccentery; 52 | x1 = sx * (cradius - 11) + ccenterx; 53 | yy1 = sy * (cradius - 11) + ccentery; 54 | tft.drawLine(x0, yy0, x1, yy1, BLUE); 55 | } 56 | } 57 | 58 | static uint8_t conv2d(const char* p) { 59 | uint8_t v = 0; 60 | if ('0' <= *p && *p <= '9') v = *p - '0'; 61 | return 10 * v + *++p - '0'; 62 | } 63 | 64 | void setup(void) { 65 | tft.begin(); 66 | 67 | tft.setTextColor(WHITE, BLACK); 68 | ccenterx = tft.width() / 2; 69 | ccentery = tft.height() / 2; 70 | osx = ccenterx; 71 | osy = ccentery; 72 | omx = ccenterx; 73 | omy = ccentery; 74 | ohx = ccenterx; 75 | ohy = ccentery; 76 | drawClockFace();// Draw clock face 77 | //get current time from compiler 78 | hh = conv2d(__TIME__); 79 | mm = conv2d(__TIME__ + 3); 80 | ss = conv2d(__TIME__ + 6); 81 | targetTime = millis() + 1000; 82 | } 83 | 84 | void drawClockHands(uint8_t h, uint8_t m, uint8_t s) { 85 | // Pre-compute hand degrees, x & y coords for a fast screen update 86 | sdeg = s * 6; // 0-59 -> 0-354 87 | mdeg = m * 6 + sdeg * 0.01666667; // 0-59 -> 0-360 - includes seconds 88 | hdeg = h * 30 + mdeg * 0.0833333; // 0-11 -> 0-360 - includes minutes and seconds 89 | hx = cos((hdeg - 90) * scosConst); 90 | hy = sin((hdeg - 90) * scosConst); 91 | mx = cos((mdeg - 90) * scosConst); 92 | my = sin((mdeg - 90) * scosConst); 93 | sx = cos((sdeg - 90) * scosConst); 94 | sy = sin((sdeg - 90) * scosConst); 95 | 96 | // Erase just old hand positions 97 | tft.drawLine(ohx, ohy, ccenterx + 1, ccentery + 1, BLACK); 98 | tft.drawLine(omx, omy, ccenterx + 1, ccentery + 1, BLACK); 99 | tft.drawLine(osx, osy, ccenterx + 1, ccentery + 1, BLACK); 100 | // Draw new hand positions 101 | tft.drawLine(hx * (cradius - 28) + ccenterx + 1, hy * (cradius - 28) + ccentery + 1, ccenterx + 1, ccentery + 1, WHITE); 102 | tft.drawLine(mx * (cradius - 17) + ccenterx + 1, my * (cradius - 17) + ccentery + 1, ccenterx + 1, ccentery + 1, WHITE); 103 | tft.drawLine(sx * (cradius - 14) + ccenterx + 1, sy * (cradius - 14) + ccentery + 1, ccenterx + 1, ccentery + 1, RED); 104 | tft.fillCircle(ccenterx + 1, ccentery + 1, 3, RED); 105 | 106 | // Update old x&y coords 107 | osx = sx * (cradius - 14) + ccenterx + 1; 108 | osy = sy * (cradius - 14) + ccentery + 1; 109 | omx = mx * (cradius - 17) + ccenterx + 1; 110 | omy = my * (cradius - 17) + ccentery + 1; 111 | ohx = hx * (cradius - 28) + ccenterx + 1; 112 | ohy = hy * (cradius - 28) + ccentery + 1; 113 | } 114 | 115 | 116 | void loop() { 117 | if (targetTime < millis()) { 118 | targetTime = millis() + 1000; 119 | ss++; 120 | if (ss == 60) { 121 | ss = 0; 122 | mm++; 123 | if (mm > 59) { 124 | mm = 0; 125 | hh++; 126 | if (hh > 23) hh = 0; 127 | } 128 | } 129 | drawClockHands(hh, mm, ss); 130 | 131 | } 132 | } 133 | 134 | -------------------------------------------------------------------------------- /examples/ColorMood_example/ColorMood_example.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | /* 6 | Teensy3.x and Arduino's 7 | You are using 4 wire SPI here, so: 8 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 9 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 10 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 11 | ESP8266----------------------------------- 12 | Use: 13 | #define __CS 16 //(D0) 14 | #define __DC 5 //(D1) 15 | #define __RST 4 //(D2) 16 | 17 | SCLK:D5 18 | MOSI:D7 19 | */ 20 | #define __CS1 10 21 | #define __DC 9 22 | /* 23 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 24 | Arduino's 8 bit: any 25 | DUE: check arduino site 26 | If you do not use reset, tie it to +3V3 27 | */ 28 | 29 | 30 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 31 | 32 | 33 | float angle; 34 | 35 | void setup() 36 | { 37 | tft.begin(); 38 | 39 | } 40 | 41 | // Translate a hue "angle" -120 to 120 degrees (ie -2PI/3 to 2PI/3) to 42 | // a 6-bit R channel value 43 | // 44 | // This is very slow on a microcontroller, not a great example! 45 | inline int angle_to_channel(float a) { 46 | if (a < -PI) a += 2 * PI; 47 | if (a < -2 * PI / 3 || a > 2 * PI / 3) return 0; 48 | float f_channel = cos(a * 3 / 4); // remap 120-degree 0-1.0 to 90 ?? 49 | return ceil(f_channel * 255);//63 50 | } 51 | 52 | void loop() { 53 | uint16_t clr = (((angle_to_channel(angle - 4 * PI / 3) >> 1) & 0xF8) << 8) | (((angle_to_channel(angle - 2 * PI / 3)) & 0xFC) << 3) | ((angle_to_channel(angle) >> 1) >> 3); 54 | tft.fillScreen(clr); 55 | 56 | angle += 0.01; 57 | if (angle > PI) 58 | angle -= 2 * PI; 59 | } -------------------------------------------------------------------------------- /examples/Solid3D_example/Solid3D_example.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | //uncomment for wireframe 5 | //#define _WIREFRAME 6 | /* 7 | ESP8266----------------------------------- 8 | Use: 9 | #define __CS 16 //(D0) 10 | #define __DC 5 //(D1) 11 | #define __RST 4 //(D2) 12 | 13 | SCLK:D5 14 | MOSI:D7 15 | */ 16 | 17 | #define __CS1 10 18 | #define __DC 9 19 | 20 | 21 | TFT_ILI9163C tft = TFT_ILI9163C(__CS1, __DC); 22 | 23 | 24 | struct pt3d 25 | { 26 | int16_t x, y, z; 27 | }; 28 | 29 | struct surface 30 | { 31 | uint8_t p[4]; 32 | int16_t z; 33 | }; 34 | 35 | struct pt2d 36 | { 37 | int16_t x, y; 38 | unsigned is_visible; 39 | }; 40 | 41 | 42 | // define a value that corresponds to "1" 43 | #define U 50 44 | 45 | // eye to screen distance (fixed) 46 | #define ZS U 47 | 48 | // cube edge length is 2*U 49 | struct pt3d cube[8] = 50 | { 51 | { -U, -U, U}, 52 | { U, -U, U}, 53 | { U, -U, -U}, 54 | { -U, -U, -U}, 55 | { -U, U, U}, 56 | { U, U, U}, 57 | { U, U, -U}, 58 | { -U, U, -U}, 59 | }; 60 | 61 | // define the surfaces 62 | struct surface cube_surface[6] = 63 | { 64 | { {0, 1, 2, 3}, 0 }, // bottom 65 | { {4, 5, 6, 7}, 0 }, // top 66 | { {0, 1, 5, 4}, 0 }, // back 67 | 68 | { {3, 7, 6, 2}, 0 }, // front 69 | { {1, 2, 6, 5}, 0 }, // right 70 | { {0, 3, 7, 4}, 0 }, // left 71 | }; 72 | 73 | // define some structures for the copy of the box, calculation will be done there 74 | struct pt3d cube2[8]; 75 | struct pt2d cube_pt[8]; 76 | 77 | // will contain a rectangle border of the box projection into 2d plane 78 | int16_t x_min, x_max; 79 | int16_t y_min, y_max; 80 | 81 | const int16_t sin_tbl[65] = { 82 | 0, 1606, 3196, 4756, 6270, 7723, 9102, 10394, 11585, 12665, 13623, 14449, 15137, 15679, 16069, 16305, 16384, 16305, 16069, 15679, 83 | 15137, 14449, 13623, 12665, 11585, 10394, 9102, 7723, 6270, 4756, 3196, 1606, 0, -1605, -3195, -4755, -6269, -7722, -9101, -10393, 84 | -11584, -12664, -13622, -14448, -15136, -15678, -16068, -16304, -16383, -16304, -16068, -15678, -15136, -14448, -13622, -12664, -11584, -10393, -9101, -7722, 85 | -6269, -4755, -3195, -1605, 0 86 | }; 87 | 88 | const int16_t cos_tbl[65] = { 89 | 16384, 16305, 16069, 15679, 15137, 14449, 13623, 12665, 11585, 10394, 9102, 7723, 6270, 4756, 3196, 1606, 0, -1605, -3195, -4755, 90 | -6269, -7722, -9101, -10393, -11584, -12664, -13622, -14448, -15136, -15678, -16068, -16304, -16383, -16304, -16068, -15678, -15136, -14448, -13622, -12664, 91 | -11584, -10393, -9101, -7722, -6269, -4755, -3195, -1605, 0, 1606, 3196, 4756, 6270, 7723, 9102, 10394, 11585, 12665, 13623, 14449, 92 | 15137, 15679, 16069, 16305, 16384 93 | }; 94 | 95 | 96 | void copy_cube(void) 97 | { 98 | uint8_t i; 99 | for (i = 0; i < 8; i++) 100 | { 101 | cube2[i] = cube[i]; 102 | } 103 | } 104 | 105 | void rotate_cube_y(uint16_t w) 106 | { 107 | uint8_t i; 108 | int16_t x, z; 109 | /* 110 | x' = x * cos(w) + z * sin(w) 111 | z' = - x * sin(w) + z * cos(w) 112 | */ 113 | for (i = 0; i < 8; i++) 114 | { 115 | x = ((int32_t)cube2[i].x * (int32_t)cos_tbl[w] + (int32_t)cube2[i].z * (int32_t)sin_tbl[w]) >> 14; 116 | z = (-(int32_t)cube2[i].x * (int32_t)sin_tbl[w] + (int32_t)cube2[i].z * (int32_t)cos_tbl[w]) >> 14; 117 | //printf("%d: %d %d --> %d %d\n", i, cube2[i].x, cube2[i].z, x, z); 118 | cube2[i].x = x; 119 | cube2[i].z = z; 120 | } 121 | } 122 | 123 | void rotate_cube_x(uint16_t w) 124 | { 125 | uint8_t i; 126 | int16_t y, z; 127 | for (i = 0; i < 8; i++) 128 | { 129 | y = ((int32_t)cube2[i].y * (int32_t)cos_tbl[w] + (int32_t)cube2[i].z * (int32_t)sin_tbl[w]) >> 14; 130 | z = (-(int32_t)cube2[i].y * (int32_t)sin_tbl[w] + (int32_t)cube2[i].z * (int32_t)cos_tbl[w]) >> 14; 131 | cube2[i].y = y; 132 | cube2[i].z = z; 133 | } 134 | } 135 | 136 | void trans_cube(uint16_t z) 137 | { 138 | uint8_t i; 139 | for (i = 0; i < 8; i++) 140 | { 141 | cube2[i].z += z; 142 | } 143 | } 144 | 145 | void reset_min_max(void) 146 | { 147 | x_min = 0x07fff; 148 | y_min = 0x07fff; 149 | x_max = -0x07fff; 150 | y_max = -0x07fff; 151 | } 152 | 153 | // calculate xs and ys from a 3d value 154 | void convert_3d_to_2d(struct pt3d *p3, struct pt2d *p2) 155 | { 156 | int32_t t; 157 | p2->is_visible = 1; 158 | if (p3->z >= ZS) 159 | { 160 | t = ZS; 161 | t *= p3->x; 162 | t <<= 1; 163 | t /= p3->z; 164 | if (t >= -(tft.width()/2) && t <= (tft.width()/2) - 1) 165 | { 166 | t += (tft.width()/2); 167 | p2->x = t; 168 | 169 | if (x_min > t) x_min = t; 170 | if (x_max < t) x_max = t; 171 | 172 | t = ZS; 173 | t *= p3->y; 174 | t <<= 1; 175 | t /= p3->z; 176 | if (t >= -(tft.height()/2) && t <= (tft.height()/2) - 1) 177 | { 178 | t += (tft.height()/2); 179 | p2->y = t; 180 | if (y_min > t) y_min = t; 181 | if (y_max < t) y_max = t; 182 | } 183 | else 184 | { 185 | p2->is_visible = 0; 186 | } 187 | } 188 | else 189 | { 190 | p2->is_visible = 0; 191 | } 192 | } 193 | else 194 | { 195 | p2->is_visible = 0; 196 | } 197 | } 198 | 199 | void convert_cube(void) 200 | { 201 | uint8_t i; 202 | reset_min_max(); 203 | for (i = 0; i < 8; i++) 204 | { 205 | convert_3d_to_2d(cube2 + i, cube_pt + i); 206 | } 207 | } 208 | 209 | void calculate_z(void) 210 | { 211 | uint8_t i, j; 212 | uint16_t z; 213 | for (i = 0; i < 6; i++) 214 | { 215 | z = 0; 216 | for (j = 0; j < 4; j++) 217 | { 218 | z += cube2[cube_surface[i].p[j]].z; 219 | } 220 | z /= 4; 221 | cube_surface[i].z = z; 222 | //printf("%d: z=%d\n", i, z); 223 | } 224 | } 225 | 226 | void draw_cube(void) 227 | { 228 | uint8_t i, ii; 229 | uint8_t skip_cnt = 3; /* it is known, that the first 3 surfaces are invisible */ 230 | int16_t z, z_upper; 231 | uint16_t color; 232 | 233 | z_upper = 32767; 234 | for (;;) 235 | { 236 | ii = 6; 237 | z = -32767; 238 | for (i = 0; i < 6; i++) 239 | { 240 | if (cube_surface[i].z <= z_upper) 241 | { 242 | if (z < cube_surface[i].z) 243 | { 244 | z = cube_surface[i].z; 245 | ii = i; 246 | } 247 | } 248 | } 249 | 250 | if (ii >= 6) break; 251 | z_upper = cube_surface[ii].z; 252 | cube_surface[ii].z++; 253 | 254 | if (skip_cnt > 0) 255 | { 256 | skip_cnt--; 257 | } 258 | else 259 | { 260 | color = tft.Color565((uint8_t)(((ii + 1) & 1) * 255), (uint8_t)((((ii + 1) >> 1) & 1) * 255), (uint8_t)((((ii + 1) >> 2) & 1) * 255)); 261 | #if defined(_WIREFRAME) 262 | tft.drawQuad( 263 | cube_pt[cube_surface[ii].p[0]].x, cube_pt[cube_surface[ii].p[0]].y, 264 | cube_pt[cube_surface[ii].p[1]].x, cube_pt[cube_surface[ii].p[1]].y, 265 | cube_pt[cube_surface[ii].p[2]].x, cube_pt[cube_surface[ii].p[2]].y, 266 | cube_pt[cube_surface[ii].p[3]].x, cube_pt[cube_surface[ii].p[3]].y, color); 267 | #else 268 | tft.fillQuad( 269 | cube_pt[cube_surface[ii].p[0]].x, cube_pt[cube_surface[ii].p[0]].y, 270 | cube_pt[cube_surface[ii].p[1]].x, cube_pt[cube_surface[ii].p[1]].y, 271 | cube_pt[cube_surface[ii].p[2]].x, cube_pt[cube_surface[ii].p[2]].y, 272 | cube_pt[cube_surface[ii].p[3]].x, cube_pt[cube_surface[ii].p[3]].y, color); 273 | #endif 274 | } 275 | } 276 | } 277 | 278 | void calc_and_draw(int16_t w, int16_t v) 279 | { 280 | 281 | copy_cube(); 282 | rotate_cube_y(w); 283 | rotate_cube_x(v); 284 | trans_cube(U * 8); 285 | convert_cube(); 286 | calculate_z(); 287 | draw_cube(); 288 | } 289 | 290 | 291 | void setup(void) 292 | { 293 | tft.begin(); 294 | } 295 | 296 | int16_t w = 0; 297 | int16_t v = 0; 298 | 299 | void loop(void) 300 | { 301 | calc_and_draw(w, v >> 3); 302 | v += 3; 303 | v &= 511; 304 | w++; 305 | w &= 63; 306 | delay(10); 307 | tft.fillRect(x_min, y_min, x_max - x_min + 3, y_max - y_min + 3, 0x0000); 308 | } 309 | -------------------------------------------------------------------------------- /examples/_ESP8266/Benchmark/Benchmark.ino: -------------------------------------------------------------------------------- 1 | /* 2 | A benchmark Test, specific for ES8266 3 | NOTE:you can try any example, just use the correct pins al below. 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | 10 | 11 | #define __CS 4 //GPIO4 or GPIO2 12 | #define __DC 5 //(D1) 13 | 14 | /* 15 | SCLK:D5 16 | MOSI:D7 17 | */ 18 | 19 | /* 20 | Benchmark Time (microseconds) 21 | Screen fill 463522 22 | Text 20859 23 | Text2 65199 24 | Lines 105151 25 | Horiz/Vert Lines 31895 26 | Arc 436668 27 | Rectangles (outline) 26353 28 | Rectangles (filled) 565637 29 | Circles (filled) 96712 30 | Circles (outline) 86887 31 | Triangles (outline) 33170 32 | Triangles (filled) 198780 33 | Rounded rects (outline) 53309 34 | Rounded rects (filled) 620893 35 | Done! 36 | 37 | 38 | 39 | */ 40 | 41 | SSD_13XX tft = SSD_13XX(__CS, __DC); 42 | 43 | void setup() { 44 | Serial.begin(115200); 45 | tft.begin(); 46 | Serial.println("\nBenchmark Time (microseconds)"); 47 | Serial.print("Screen fill "); 48 | Serial.println(testFillScreen()); 49 | delay(500); 50 | 51 | Serial.print("Text "); 52 | Serial.println(testText()); 53 | delay(3000); 54 | 55 | Serial.print("Text2 "); 56 | Serial.println(testText2()); 57 | delay(3000); 58 | 59 | Serial.print("Lines "); 60 | Serial.println(testLines(CYAN)); 61 | delay(500); 62 | 63 | Serial.print("Horiz/Vert Lines "); 64 | Serial.println(testFastLines(RED, BLUE)); 65 | delay(500); 66 | Serial.print("Arc "); 67 | Serial.println(testArc(CYAN)); 68 | delay(500); 69 | Serial.print("Rectangles (outline) "); 70 | Serial.println(testRects(GREEN)); 71 | delay(500); 72 | 73 | Serial.print("Rectangles (filled) "); 74 | Serial.println(testFilledRects(YELLOW, MAGENTA)); 75 | delay(500); 76 | 77 | Serial.print("Circles (filled) "); 78 | Serial.println(testFilledCircles(5, MAGENTA)); 79 | 80 | Serial.print("Circles (outline) "); 81 | Serial.println(testCircles(5, WHITE)); 82 | delay(500); 83 | 84 | Serial.print("Triangles (outline) "); 85 | Serial.println(testTriangles()); 86 | delay(500); 87 | 88 | Serial.print("Triangles (filled) "); 89 | Serial.println(testFilledTriangles()); 90 | delay(500); 91 | 92 | Serial.print("Rounded rects (outline) "); 93 | Serial.println(testRoundRects()); 94 | delay(500); 95 | 96 | Serial.print("Rounded rects (filled) "); 97 | Serial.println(testFilledRoundRects()); 98 | delay(500); 99 | 100 | Serial.println("Done!"); 101 | } 102 | 103 | void loop(void) { 104 | for (uint8_t rotation = 0; rotation < 4; rotation++) { 105 | tft.setRotation(rotation); 106 | testText(); 107 | delay(2000); 108 | } 109 | } 110 | 111 | 112 | unsigned long testFillScreen() { 113 | unsigned long start = micros(); 114 | tft.clearScreen(); 115 | tft.fillScreen(RED); 116 | tft.fillScreen(GREEN); 117 | tft.fillScreen(BLUE); 118 | tft.clearScreen(); 119 | return micros() - start; 120 | } 121 | 122 | unsigned long testText() { 123 | tft.clearScreen(); 124 | unsigned long start = micros(); 125 | tft.setCursor(0, 0); 126 | tft.setTextColor(WHITE); 127 | tft.setTextScale(1); 128 | tft.println("Hello World!"); 129 | tft.setTextColor(YELLOW); 130 | tft.setTextScale(2); 131 | tft.println(1234.56); 132 | tft.setTextColor(RED); 133 | tft.setTextScale(3); 134 | tft.println(0xDEAD, HEX); 135 | tft.println(); 136 | tft.setTextColor(GREEN); 137 | tft.setTextScale(4); 138 | tft.println("Hello"); 139 | return micros() - start; 140 | 141 | 142 | } 143 | 144 | unsigned long testText2() { 145 | tft.clearScreen(); 146 | unsigned long start = micros(); 147 | tft.setCursor(0, 0); 148 | tft.setTextColor(WHITE); 149 | tft.setTextScale(2); 150 | tft.println("I implore thee,"); 151 | tft.setTextScale(1); 152 | tft.println("my foonting turlingdromes."); 153 | tft.println("And hooptiously drangle me"); 154 | tft.println("with crinkly bindlewurdles,"); 155 | tft.println("Or I will rend thee"); 156 | tft.println("in the gobberwarts"); 157 | tft.println("with my blurglecruncheon,"); 158 | tft.println("see if I don't!"); 159 | return micros() - start; 160 | } 161 | 162 | unsigned long testLines(uint16_t color) { 163 | unsigned long start, t; 164 | int x1, y1, x2, y2, 165 | w = tft.width(), 166 | h = tft.height(); 167 | 168 | tft.clearScreen(); 169 | 170 | x1 = y1 = 0; 171 | y2 = h - 1; 172 | start = micros(); 173 | for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); 174 | x2 = w - 1; 175 | for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); 176 | t = micros() - start; // fillScreen doesn't count against timing 177 | 178 | tft.clearScreen(); 179 | 180 | x1 = w - 1; 181 | y1 = 0; 182 | y2 = h - 1; 183 | start = micros(); 184 | for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); 185 | x2 = 0; 186 | for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); 187 | t += micros() - start; 188 | 189 | tft.clearScreen(); 190 | 191 | x1 = 0; 192 | y1 = h - 1; 193 | y2 = 0; 194 | start = micros(); 195 | for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); 196 | x2 = w - 1; 197 | for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); 198 | t += micros() - start; 199 | 200 | tft.clearScreen(); 201 | 202 | x1 = w - 1; 203 | y1 = h - 1; 204 | y2 = 0; 205 | start = micros(); 206 | for (x2 = 0; x2 < w; x2 += 6) tft.drawLine(x1, y1, x2, y2, color); 207 | x2 = 0; 208 | for (y2 = 0; y2 < h; y2 += 6) tft.drawLine(x1, y1, x2, y2, color); 209 | 210 | return micros() - start; 211 | } 212 | 213 | unsigned long testFastLines(uint16_t color1, uint16_t color2) { 214 | unsigned long start; 215 | int x, y, w = tft.width(), h = tft.height(); 216 | 217 | tft.clearScreen(); 218 | start = micros(); 219 | for (y = 0; y < h; y += 5) tft.drawFastHLine(0, y, w, color1); 220 | for (x = 0; x < w; x += 5) tft.drawFastVLine(x, 0, h, color2); 221 | 222 | return micros() - start; 223 | } 224 | 225 | #if defined(_ILI9163C_DRAWARC) 226 | unsigned long testArc(uint16_t color) { 227 | unsigned long start; 228 | uint16_t i, 229 | cx = tft.width() / 2, 230 | cy = tft.height() / 2; 231 | 232 | tft.clearScreen(); 233 | 234 | start = micros(); 235 | for (i = 0; i < 360; i += 5) { 236 | tft.drawArc(cx, cy, 32, 2, 0, i, color); 237 | } 238 | return micros() - start; 239 | } 240 | #endif 241 | 242 | unsigned long testRects(uint16_t color) { 243 | unsigned long start; 244 | int n, i, i2, 245 | cx = tft.width() / 2, 246 | cy = tft.height() / 2; 247 | 248 | tft.clearScreen(); 249 | n = min(tft.width(), tft.height()); 250 | start = micros(); 251 | for (i = 2; i < n; i += 6) { 252 | i2 = i / 2; 253 | tft.drawRect(cx - i2, cy - i2, i, i, color); 254 | } 255 | 256 | return micros() - start; 257 | } 258 | 259 | unsigned long testFilledRects(uint16_t color1, uint16_t color2) { 260 | unsigned long start, t = 0; 261 | int n, i, i2, 262 | cx = (tft.width() / 2) - 1, 263 | cy = (tft.height() / 2) - 1; 264 | 265 | tft.clearScreen(); 266 | n = min(tft.width(), tft.height()); 267 | for (i = n; i > 0; i -= 6) { 268 | i2 = i / 2; 269 | start = micros(); 270 | tft.fillRect(cx - i2, cy - i2, i, i, color1); 271 | t += micros() - start; 272 | // Outlines are not included in timing results 273 | tft.drawRect(cx - i2, cy - i2, i, i, color2); 274 | } 275 | 276 | return t; 277 | } 278 | 279 | unsigned long testFilledCircles(uint8_t radius, uint16_t color) { 280 | unsigned long start; 281 | int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; 282 | 283 | tft.clearScreen(); 284 | start = micros(); 285 | for (x = radius; x < w; x += r2) { 286 | for (y = radius; y < h; y += r2) { 287 | tft.fillCircle(x, y, radius, color); 288 | } 289 | } 290 | 291 | return micros() - start; 292 | } 293 | 294 | unsigned long testCircles(uint8_t radius, uint16_t color) { 295 | unsigned long start; 296 | int x, y, r2 = radius * 2, 297 | w = tft.width() + radius, 298 | h = tft.height() + radius; 299 | 300 | // Screen is not cleared for this one -- this is 301 | // intentional and does not affect the reported time. 302 | start = micros(); 303 | for (x = 0; x < w; x += r2) { 304 | for (y = 0; y < h; y += r2) { 305 | tft.drawCircle(x, y, radius, color); 306 | } 307 | } 308 | 309 | return micros() - start; 310 | } 311 | 312 | unsigned long testTriangles() { 313 | unsigned long start; 314 | int n, i, cx = tft.width() / 2 - 1, 315 | cy = (tft.height() / 2) - 1; 316 | 317 | tft.clearScreen(); 318 | n = min(cx, cy); 319 | start = micros(); 320 | for (i = 0; i < n; i += 5) { 321 | tft.drawTriangle( 322 | cx , cy - i, // peak 323 | cx - i, cy + i, // bottom left 324 | cx + i, cy + i, // bottom right 325 | tft.Color565(0, 0, i)); 326 | } 327 | 328 | return micros() - start; 329 | } 330 | 331 | unsigned long testFilledTriangles() { 332 | unsigned long start, t = 0; 333 | int i, cx = (tft.width() / 2) - 1, 334 | cy = tft.height() / 2 - 1; 335 | 336 | tft.clearScreen(); 337 | start = micros(); 338 | for (i = min(cx, cy); i > 10; i -= 5) { 339 | start = micros(); 340 | tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 341 | tft.Color565(0, i, i)); 342 | t += micros() - start; 343 | tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 344 | tft.Color565(i, i, 0)); 345 | } 346 | 347 | return t; 348 | } 349 | 350 | unsigned long testRoundRects() { 351 | unsigned long start; 352 | int w, i, i2, 353 | cx = (tft.width() / 2) - 1, 354 | cy = (tft.height() / 2) - 1; 355 | 356 | tft.clearScreen(); 357 | w = min(tft.width(), tft.height()); 358 | start = micros(); 359 | for (i = 0; i < w; i += 6) { 360 | i2 = i / 2; 361 | tft.drawRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.Color565(i, 0, 0)); 362 | } 363 | 364 | return micros() - start; 365 | } 366 | 367 | unsigned long testFilledRoundRects() { 368 | unsigned long start; 369 | int i, i2, 370 | cx = (tft.width() / 2) - 1, 371 | cy = (tft.height() / 2) - 1; 372 | 373 | tft.clearScreen(); 374 | start = micros(); 375 | for (i = min(tft.width(), tft.height()); i > 20; i -= 6) { 376 | i2 = i / 2; 377 | tft.fillRoundRect(cx - i2, cy - i2, i, i, i / 8, tft.Color565(0, i, 0)); 378 | } 379 | 380 | return micros() - start; 381 | } -------------------------------------------------------------------------------- /examples/_ESP8266/WiFi_scan/WiFi_scan.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * This sketch demonstrates how to scan WiFi networks. 3 | * The API is almost the same as with the WiFi Shield library, 4 | * the most obvious difference being the different file you need to include: 5 | */ 6 | #include 7 | #include 8 | #include 9 | 10 | #define __CS 4 //GPIO4 or GPIO2 11 | #define __DC 5 //(D1) 12 | /* 13 | SCLK:D5 14 | MOSI:D7 15 | */ 16 | 17 | SSD_13XX tft = SSD_13XX(__CS, __DC); 18 | 19 | void setup() { 20 | Serial.begin(115200); 21 | tft.begin(); 22 | // Set WiFi to station mode and disconnect from an AP if it was previously connected 23 | WiFi.mode(WIFI_STA); 24 | WiFi.disconnect(); 25 | delay(100); 26 | } 27 | 28 | void loop() { 29 | 30 | int n = WiFi.scanNetworks(); 31 | int startNet = 0; 32 | int endNet = 7; 33 | int countNet = 1; 34 | tft.clearScreen(); 35 | tft.setCursor(0, 0); 36 | if (n == 0) { 37 | tft.print("(no networks found)"); 38 | } else { 39 | tft.print("("); 40 | tft.setTextColor(CYAN); 41 | tft.print(n); 42 | tft.setTextColor(WHITE); 43 | tft.println(" networks found)"); 44 | for (int i = startNet; i < endNet; ++i) 45 | { 46 | tft.setTextColor(MAGENTA); 47 | tft.print(i + 1); 48 | tft.setTextColor(WHITE); 49 | tft.print(":"); 50 | tft.print(WiFi.SSID(i)); 51 | tft.print("("); 52 | if (WiFi.RSSI(i) <= -80) { 53 | tft.setTextColor(RED); 54 | } else if (WiFi.RSSI(i) >= -80 && WiFi.RSSI(i) < -70) { 55 | tft.setTextColor(YELLOW); 56 | } else { 57 | tft.setTextColor(GREEN); 58 | } 59 | tft.print(WiFi.RSSI(i)); 60 | tft.setTextColor(WHITE); 61 | tft.print(")"); 62 | if (WiFi.encryptionType(i) == ENC_TYPE_NONE) { 63 | tft.setTextColor(GREEN); 64 | tft.println(); 65 | } else if (WiFi.encryptionType(i) == ENC_TYPE_WEP) { 66 | tft.setTextColor(CYAN); 67 | } else if (WiFi.encryptionType(i) == ENC_TYPE_TKIP) { 68 | tft.setTextColor(MAGENTA); 69 | } else if (WiFi.encryptionType(i) == ENC_TYPE_CCMP) { 70 | tft.setTextColor(YELLOW); 71 | } else { 72 | tft.setTextColor(RED); 73 | } 74 | tft.println("*"); 75 | tft.setTextColor(WHITE); 76 | //following not work, I will fix... 77 | if (i == 7 * countNet) { 78 | delay(2000); 79 | tft.clearScreen(); 80 | tft.setCursor(0, 0); 81 | tft.println("...continue"); 82 | countNet++; 83 | startNet = i + 7; 84 | endNet = 7 * countNet; 85 | } 86 | } 87 | } 88 | // Wait a bit before scanning again 89 | delay(3000); 90 | } -------------------------------------------------------------------------------- /examples/_ESP8266/basicSetup/basicSetup.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | #define __CS 4 //GPIO4 or GPIO2 6 | #define __DC 5 //(D1) 7 | 8 | /* 9 | SCLK:D5 10 | MOSI:D7 11 | */ 12 | 13 | 14 | SSD_13XX tft = SSD_13XX(__CS, __DC); 15 | 16 | void setup() { 17 | tft.begin(); 18 | tft.print("hello World"); 19 | } 20 | 21 | void loop(void) { 22 | } -------------------------------------------------------------------------------- /examples/_ESP8266/drawLineAngle_example/drawLineAngle_example.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Draw Line Angle Example 3 | Library has a nice function called drawLineAngle 4 | that let you draw easily needle gauges at any angle 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #define __CS_TFT 4 //GPIO4 or GPIO2 11 | #define __DC_TFT 2 //(D1) 12 | 13 | 14 | SSD_13XX tft = SSD_13XX(__CS_TFT, __DC_TFT); 15 | 16 | 17 | void setup() { 18 | Serial.begin(115200); 19 | tft.begin(); 20 | tft.drawCircle(31, 31, 27, WHITE);//draw round gauge 21 | tft.drawCircle(31, 31, 26, WHITE);//draw round gauge 22 | } 23 | 24 | void loop() { 25 | for (int i = 0; i <= 360; i++) { 26 | if (i > 0) tft.drawLineAngle(31, 31, i - 1, 25, BLACK);//erase previous needle 27 | tft.drawLineAngle(31, 31, i, 25, GREEN);//draw needle 28 | delay(10); 29 | } 30 | } 31 | 32 | -------------------------------------------------------------------------------- /examples/_ESP8266/externalFonts/externalFonts.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This sketch shows how to use other fonts 3 | and some new text commands 4 | 5 | */ 6 | #include 7 | #include 8 | #include "_fonts/unborn_small.c" 9 | 10 | 11 | #define __CS 4 //GPIO4 or GPIO2 12 | #define __DC 2 //(D1) 13 | 14 | SSD_13XX tft = SSD_13XX(__CS, __DC);//we dont use rst, tie reset pin to 3v3 15 | 16 | void setup() { 17 | Serial.begin(115200); 18 | Serial.print("\nstarted\n"); 19 | tft.begin(); 20 | /* 21 | after this command the library has already set several 22 | things as default: 23 | tft.clearScreen();//screen cleared with black 24 | tft.setRotation(0);//no rotation 25 | tft.setTextScale(1);//no scale 26 | tft.setCursor(0,0); 27 | tft.setTextWrap(true);//text will wrap to a new line automatically 28 | tft.setTextColor(WHITE,WHITE);//background transparent 29 | //default internal font loaded arial_x2 30 | This allow you to start writing immediately without 31 | need to set anything. 32 | */ 33 | tft.setFont(&unborn_small);//this will load the font 34 | tft.println("Hello world!");//this will add a new line as well 35 | tft.setTextScale(3);//now multiply x 3 the scale 36 | tft.println("Hello world!");//the wrap on will split words in 2 lines 37 | tft.setInternalFont();//now switch to internal font 38 | tft.setTextScale(2);//smaller 39 | tft.setFontInterline(2);//this will be active after the println! 40 | tft.println("Hello world!"); 41 | tft.setCharSpacing(1);//add an extra pixel between chars 42 | tft.setTextColor(WHITE, BLUE); //set a background inside font 43 | tft.println("Hello world!"); 44 | } 45 | 46 | void loop() { 47 | 48 | } -------------------------------------------------------------------------------- /examples/avr_benchmark/avr_benchmark.ino: -------------------------------------------------------------------------------- 1 | /* 2 | AVR Benchmark version 0.5 3 | */ 4 | 5 | 6 | #include 7 | #include 8 | 9 | 10 | #define __CS1 10 11 | #define __DC 9 12 | 13 | 14 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 15 | 16 | unsigned long t_start,t_end; 17 | uint8_t rotation; 18 | uint8_t x,y; 19 | uint8_t i; 20 | 21 | 22 | void setup() 23 | { 24 | Serial.begin(38400); 25 | tft.begin(); 26 | 27 | } 28 | 29 | void clearS() 30 | { 31 | tft.clearScreen(); 32 | } 33 | 34 | void waitAlittle() 35 | { 36 | delay(500); 37 | } 38 | 39 | 40 | void testFillScreen() { 41 | clearS(); 42 | t_start = micros(); 43 | tft.fillScreen(RED); 44 | t_end = micros() - t_start; 45 | Serial.println(t_end); 46 | } 47 | 48 | void testText() { 49 | clearS(); 50 | t_start = micros(); 51 | tft.setCursor(0, 0); 52 | tft.setTextColor(WHITE); 53 | tft.setTextScale(1); 54 | tft.println("Hello World!"); 55 | tft.setTextColor(YELLOW); 56 | tft.setTextScale(2); 57 | tft.println(1234.56); 58 | tft.setTextColor(RED); 59 | tft.setTextScale(3); 60 | tft.println(0xDEAD, HEX); 61 | tft.println(); 62 | tft.setTextColor(GREEN); 63 | tft.setTextScale(4); 64 | tft.println("Hello"); 65 | t_end = micros() - t_start; 66 | Serial.println(t_end); 67 | } 68 | 69 | 70 | 71 | void testLines(void) { 72 | int x2, y2; 73 | 74 | x = y = 0; 75 | y2 = tft.height()-1; 76 | t_start = micros(); 77 | for (x2 = 0; x2 < tft.width(); x2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 78 | x2 = tft.width()-1; 79 | for (y2 = 0; y2 < tft.height(); y2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 80 | t_end = micros() - t_start; // fillScreen doesn't count against timing 81 | 82 | clearS(); 83 | 84 | x = tft.width()-1; 85 | y = 0; 86 | y2 = tft.height()-1; 87 | t_start = micros(); 88 | for (x2 = 0; x2 < tft.width(); x2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 89 | x2 = 0; 90 | for (y2 = 0; y2 < tft.height(); y2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 91 | t_end += (micros() - t_start); 92 | 93 | clearS(); 94 | 95 | x = 0; 96 | y = tft.height()-1; 97 | y2 = 0; 98 | t_start = micros(); 99 | for (x2 = 0; x2 < tft.width(); x2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 100 | x2 = tft.width()-1; 101 | for (y2 = 0; y2 < tft.height(); y2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 102 | t_end += (micros() - t_start); 103 | 104 | clearS(); 105 | 106 | x = tft.width()-1; 107 | y = tft.height()-1; 108 | y2 = 0; 109 | t_start = micros(); 110 | for (x2 = 0; x2 < tft.width(); x2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 111 | x2 = 0; 112 | for (y2 = 0; y2 < tft.height(); y2 += 6) tft.drawLine(x, y, x2, y2, CYAN); 113 | t_end += (micros() - t_start); 114 | Serial.println(t_end); 115 | } 116 | 117 | void testFastLines(void) { 118 | t_start = micros(); 119 | for (y = 0; y < tft.height(); y += 5) tft.drawFastHLine(0, y, tft.width()-1, RED); 120 | for (x = 0; x < tft.width(); x += 5) tft.drawFastVLine(x, 0, tft.height()-1, BLUE); 121 | t_end += (micros() - t_start); 122 | Serial.println(t_end); 123 | } 124 | 125 | void testRects(bool filled) { 126 | t_start = micros(); 127 | for (i = tft.height(); i > 4; i -= 4) { 128 | if (filled) { 129 | t_start = micros(); 130 | tft.fillRect((tft.width()/2) - (i / 2), (tft.height()/2) - (i / 2), i, i, YELLOW, BLACK); 131 | t_end += micros() - t_start; 132 | } 133 | tft.drawRect((tft.width()/2) - (i / 2), (tft.height()/2) - (i / 2), i, i, MAGENTA); 134 | } 135 | if (!filled) t_end += (micros() - t_start); 136 | Serial.println(t_end); 137 | } 138 | 139 | 140 | void testCircles(bool filled) { 141 | t_start = micros(); 142 | for (x = 0; x < tft.width(); x += 10) { 143 | for (y = 0; y < tft.height(); y += 10) { 144 | if (filled) { 145 | tft.fillCircle(x, y, 5, BLUE); 146 | } else { 147 | tft.drawCircle(x, y, 5, YELLOW); 148 | } 149 | } 150 | } 151 | t_end += (micros() - t_start); 152 | Serial.println(t_end); 153 | } 154 | 155 | void testTriangles() { 156 | t_start = micros(); 157 | uint8_t val = 32; 158 | for (i = 0; i < val; i += 4) { 159 | tft.drawTriangle( 160 | val-1, val-1 - i, // peak 161 | val-1 - i, val-1 + i, // bottom left 162 | val-1 + i, val-1 + i, // bottom right 163 | tft.Color565(0, 0, i)); 164 | } 165 | t_end += (micros() - t_start); 166 | Serial.println(t_end); 167 | } 168 | 169 | 170 | void printSpaces(uint8_t spaces) 171 | { 172 | for (i = 0; i < spaces; i++) { 173 | Serial.write(' '); 174 | } 175 | } 176 | 177 | 178 | 179 | void loop() 180 | { 181 | 182 | for (rotation = 0; rotation < 4; rotation++) { 183 | clearS(); 184 | tft.setRotation(rotation); 185 | Serial.print(F("\nBenchmark[rot=")); 186 | Serial.print(rotation); 187 | Serial.println(F("] (ms)")); 188 | 189 | Serial.print(F("Screen(F)")); 190 | printSpaces(16); 191 | clearS(); 192 | testFillScreen(); 193 | waitAlittle(); 194 | 195 | Serial.print(F("Text")); 196 | printSpaces(21); 197 | clearS(); 198 | testText(); 199 | waitAlittle(); 200 | 201 | Serial.print(F("Lines")); 202 | printSpaces(20); 203 | clearS(); 204 | testLines(); 205 | waitAlittle(); 206 | 207 | Serial.print(F("Lines2")); 208 | printSpaces(19); 209 | clearS(); 210 | testFastLines(); 211 | waitAlittle(); 212 | 213 | Serial.print(F("Rectangles")); 214 | printSpaces(15); 215 | clearS(); 216 | testRects(false); 217 | waitAlittle(); 218 | 219 | Serial.print(F("Rectangles(F)")); 220 | printSpaces(12); 221 | clearS(); 222 | testRects(true); 223 | waitAlittle(); 224 | 225 | Serial.print(F("Circles(F)")); 226 | printSpaces(15); 227 | testCircles(true); 228 | waitAlittle(); 229 | 230 | Serial.print(F("Circles")); 231 | printSpaces(18); 232 | testCircles(false); 233 | waitAlittle(); 234 | } 235 | 236 | } 237 | 238 | 239 | -------------------------------------------------------------------------------- /examples/basicSetup/basicSetup.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* 5 | Teensy3.x and Arduino's 6 | You are using 4 wire SPI here, so: 7 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 8 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 9 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 10 | ESP8266----------------------------------- 11 | Use: 12 | #define __CS 16 //(D0) 13 | #define __DC 5 //(D1) 14 | #define __RST 4 //(D2) 15 | 16 | SCLK:D5 17 | MOSI:D7 18 | */ 19 | #define __CS1 10 20 | #define __DC 9 21 | /* 22 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 23 | Arduino's 8 bit: any 24 | DUE: check arduino site 25 | If you do not use reset, tie it to +3V3 26 | */ 27 | 28 | uint8_t errorCode = 0; 29 | 30 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 31 | 32 | void setup() { 33 | Serial.begin(38400); 34 | long unsigned debug_start = millis(); 35 | while (!Serial && ((millis() - debug_start) <= 5000)); 36 | Serial.println("serial ok, testing lib..."); 37 | tft.begin(); 38 | //the following it's mainly for Teensy 39 | //it will help you to understand if you have choosed the 40 | //wrong combination of pins! 41 | errorCode = tft.getErrorCode(); 42 | if (errorCode != 0) { 43 | Serial.print("Init error! "); 44 | if (bitRead(errorCode, 0)) Serial.print("MOSI or SCLK pin mismach!\n"); 45 | if (bitRead(errorCode, 1)) Serial.print("CS or DC pin mismach!\n"); 46 | } 47 | else { 48 | tft.print("Ready!"); 49 | } 50 | } 51 | 52 | 53 | void loop(void) { 54 | 55 | } -------------------------------------------------------------------------------- /examples/benchmark_version2.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sumotoy/SSD_13XX/aed648a0430a1cdd9c4c2512f7971b0dddaeb26f/examples/benchmark_version2.rar -------------------------------------------------------------------------------- /examples/bigtest/bigtest.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | 6 | /* 7 | Teensy3.x and Arduino's 8 | You are using 4 wire SPI here, so: 9 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 10 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 11 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 12 | the rest of pin below: 13 | */ 14 | #define __CS1 10 15 | #define __DC 9 16 | /* 17 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 18 | Arduino's 8 bit: anY 19 | DUE: check arduino site 20 | If you do not use reset, tie it to +3V3 21 | ESP8266----------------------------------- 22 | Use: 23 | #define __CS 16 //(D0) 24 | #define __DC 5 //(D1) 25 | #define __RST 4 //(D2) 26 | 27 | SCLK:D5 28 | MOSI:D7 29 | */ 30 | 31 | 32 | 33 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 34 | 35 | 36 | float p = 3.1415926; 37 | 38 | 39 | 40 | void testlines(uint16_t color) { 41 | tft.clearScreen(); 42 | for (int16_t x = 0; x < tft.width() - 1; x += 6) { 43 | tft.drawLine(0, 0, x, tft.height() - 1, color); 44 | } 45 | for (int16_t y = 0; y < tft.height() - 1; y += 6) { 46 | tft.drawLine(0, 0, tft.width() - 1, y, color); 47 | } 48 | tft.clearScreen(); 49 | for (int16_t x = 0; x < tft.width() - 1; x += 6) { 50 | tft.drawLine(tft.width() - 1, 0, x, tft.height() - 1, color); 51 | } 52 | for (int16_t y = 0; y < tft.height() - 1; y += 6) { 53 | tft.drawLine(tft.width() - 1, 0, 0, y, color); 54 | } 55 | 56 | tft.clearScreen(); 57 | for (int16_t x = 0; x < tft.width() - 1; x += 6) { 58 | tft.drawLine(0, tft.height() - 1, x, 0, color); 59 | } 60 | for (int16_t y = 0; y < tft.height() - 1; y += 6) { 61 | tft.drawLine(0, tft.height() - 1, tft.width() - 1, y, color); 62 | } 63 | tft.clearScreen(); 64 | for (int16_t x = 0; x < tft.width() - 1; x += 6) { 65 | tft.drawLine(tft.width() - 1, tft.height() - 1, x, 0, color); 66 | } 67 | for (int16_t y = 0; y < tft.height() - 1; y += 6) { 68 | tft.drawLine(tft.width() - 1, tft.height() - 1, 0, y, color); 69 | } 70 | delay(500); 71 | } 72 | 73 | 74 | void testdrawtext(char *text, uint16_t color) { 75 | tft.setTextScale(1); 76 | tft.setTextColor(WHITE); 77 | tft.setCursor(0, 0); 78 | 79 | for (uint8_t i = 0; i < 168; i++) { 80 | if (i == '\n') continue; 81 | tft.write(i); 82 | if ((i > 0) && (i % 21 == 0)) 83 | tft.println(); 84 | } 85 | } 86 | 87 | void testfastlines(uint16_t color1, uint16_t color2) { 88 | tft.clearScreen(); 89 | for (int16_t y = 0; y < tft.height() - 1; y += 5) { 90 | tft.drawFastHLine(0, y, tft.width() - 1, color1); 91 | } 92 | for (int16_t x = 0; x < tft.width() - 1; x += 5) { 93 | tft.drawFastVLine(x, 0, tft.height() - 1, color2); 94 | } 95 | } 96 | 97 | void testdrawrects(uint16_t color) { 98 | tft.clearScreen(); 99 | for (int16_t x = 0; x < tft.height() - 1; x += 6) { 100 | tft.drawRect((tft.width() - 1) / 2 - x / 2, (tft.height() - 1) / 2 - x / 2, x, x, color); 101 | } 102 | } 103 | 104 | void testfillrects(uint16_t color1, uint16_t color2) { 105 | tft.clearScreen(); 106 | for (int16_t x = tft.height() - 1; x > 6; x -= 6) { 107 | tft.fillRect((tft.width() - 1) / 2 - x / 2, (tft.height() - 1) / 2 - x / 2, x, x, color1); 108 | tft.drawRect((tft.width() - 1) / 2 - x / 2, (tft.height() - 1) / 2 - x / 2, x, x, color2); 109 | } 110 | } 111 | 112 | void testfillcircles(uint8_t radius, uint16_t color) { 113 | for (uint8_t x = radius; x < tft.width() - 1; x += radius * 2) { 114 | for (uint8_t y = radius; y < tft.height() - 1; y += radius * 2) { 115 | tft.fillCircle(x, y, radius, color); 116 | } 117 | } 118 | } 119 | 120 | void testdrawcircles(uint8_t radius, uint16_t color) { 121 | for (int16_t x = 0; x < (tft.width() - 1) + radius; x += radius * 2) { 122 | for (int16_t y = 0; y < (tft.height()) - 1 + radius; y += radius * 2) { 123 | tft.drawCircle(x, y, radius, color); 124 | } 125 | } 126 | } 127 | 128 | void testtriangles() { 129 | tft.clearScreen(); 130 | int color = 0xF800; 131 | int t; 132 | int w = tft.width() / 2; 133 | int x = tft.height(); 134 | int y = 0; 135 | int z = tft.width(); 136 | for (t = 0; t <= 15; t += 1) { 137 | tft.drawTriangle(w, y, y, x, z, x, color); 138 | x -= 4; 139 | y += 4; 140 | z -= 4; 141 | color += 100; 142 | } 143 | } 144 | 145 | void testroundrects() { 146 | tft.clearScreen(); 147 | int color = 100; 148 | int i; 149 | int t; 150 | for (t = 0; t <= 4; t += 1) { 151 | int x = 0; 152 | int y = 0; 153 | int w = tft.width(); 154 | int h = tft.height(); 155 | for (i = 0; i <= 24; i += 1) { 156 | tft.drawRoundRect(x, y, w, h, 5, color); 157 | x += 2; 158 | y += 3; 159 | w -= 4; 160 | h -= 6; 161 | color += 1100; 162 | } 163 | color += 100; 164 | } 165 | } 166 | 167 | void tftPrintTest() { 168 | tft.clearScreen(); 169 | tft.setCursor(0, 5); 170 | tft.setTextColor(RED); 171 | tft.setTextScale(1); 172 | tft.println("Hello World!"); 173 | tft.setTextColor(YELLOW, GREEN); 174 | tft.setTextScale(2); 175 | tft.print("Hello Wo"); 176 | tft.setTextColor(BLUE); 177 | tft.setTextScale(3); 178 | tft.print(12.57); 179 | delay(1500); 180 | tft.setCursor(0, 5); 181 | tft.clearScreen(); 182 | tft.setTextColor(WHITE); 183 | tft.setTextScale(0); 184 | tft.println("Hello World!"); 185 | tft.setTextScale(1); 186 | tft.setTextColor(GREEN); 187 | tft.print(p, 5); 188 | tft.println(" Want pi?"); 189 | tft.print(8675309, HEX); 190 | tft.print(" Print HEX"); 191 | tft.setTextColor(WHITE); 192 | tft.println("Sketch has been"); 193 | tft.println("running for: "); 194 | tft.setTextColor(MAGENTA); 195 | tft.print(millis() / 1000); 196 | tft.setTextColor(WHITE); 197 | tft.print(" sec."); 198 | } 199 | 200 | 201 | void randomRect(bool fill) { 202 | tft.clearScreen(); 203 | uint8_t k, c; 204 | for (k = 0; k < 16; k++) { 205 | for (c = 0; c < 32; c++) { 206 | uint8_t cx, cy, x, y, w, h; 207 | // center 208 | cx = random(0, tft.width()); 209 | cy = random(0, tft.height()); 210 | // size 211 | w = random(0, 30 + 6); 212 | h = random(0, 20 + 4); 213 | // upper-left 214 | x = cx - w / 2; 215 | y = cy - h / 2; 216 | if (x < 0) x = 0; 217 | if (y < 0) y = 0; 218 | // adjust size 219 | if (x + w > tft.width()) w = tft.width() - x; 220 | if (y + h > tft.height()) h = tft.height() - y; 221 | if (fill) { 222 | tft.fillRect(x, y, w, h, random(0x0010, 0xFFFF)); 223 | } 224 | else { 225 | tft.drawRect(x, y, w, h, random(0x0010, 0xFFFF)); 226 | } 227 | 228 | } 229 | tft.clearScreen(); 230 | } 231 | } 232 | 233 | void randomCircles(bool fill) { 234 | tft.clearScreen(); 235 | uint8_t k, c; 236 | for (k = 0; k < tft.height(); k++) { 237 | for (c = 0; c < tft.height() / 2; c++) { 238 | // coordinates 239 | uint8_t x = random(0, 120 + 3), y = random(0, 90 + 2), r = random(0, 40 + 1); 240 | if (x - r < 0) r = x; 241 | if (x + r >(tft.width() - 1)) r = (tft.width() - 1) - x; 242 | if (y - r < 0) r = y; 243 | if (y + r >(tft.height() - 1)) r = (tft.height() - 1) - y; 244 | if (fill) { 245 | tft.fillCircle(x, y, r, random(0x0010, 0xFFFF)); 246 | } 247 | else { 248 | tft.drawCircle(x, y, r, random(0x0010, 0xFFFF)); 249 | } 250 | } 251 | if (!fill)tft.clearScreen(); 252 | } 253 | } 254 | 255 | 256 | void randomLines() { 257 | tft.clearScreen(); 258 | uint8_t k, c; 259 | for (k = 0; k < tft.height(); k++) { 260 | for (c = 0; c < tft.height() / 2; c++) { 261 | uint8_t x1 = random(0, tft.width()), y1 = random(0, tft.height()), x2 = random(0, tft.width()), y2 = random(0, tft.height()); 262 | tft.drawLine(x1, y1, x2, y2, random(0x0010, 0xFFFF)); 263 | } 264 | tft.clearScreen(); 265 | } 266 | } 267 | 268 | 269 | void randomPoints() { 270 | tft.clearScreen(); 271 | int k, c; 272 | for (k = 0; k < 128; k++) { 273 | for (c = 0; c < 1000; c++) { 274 | uint8_t x = random(0, tft.width()), y = random(0, tft.height()); 275 | tft.drawPixel(x, y, random(0x0010, 0xFFFF)); 276 | } 277 | tft.clearScreen(); 278 | } 279 | } 280 | 281 | void setup(void) { 282 | tft.begin(); 283 | 284 | 285 | uint16_t time = millis(); 286 | time = millis() - time; 287 | 288 | // lcdTestPattern(); 289 | // delay(1000); 290 | 291 | tft.clearScreen(); 292 | tft.setCursor(0,0); 293 | tft.print("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa"); 294 | delay(1000); 295 | 296 | tftPrintTest(); 297 | delay(2000); 298 | 299 | //a single pixel 300 | tft.drawPixel(tft.width()/2, tft.height()/2, GREEN); 301 | delay(500); 302 | 303 | // line draw test 304 | testlines(YELLOW); 305 | delay(500); 306 | 307 | // optimized lines 308 | testfastlines(RED, BLUE); 309 | delay(500); 310 | 311 | testdrawrects(GREEN); 312 | delay(1000); 313 | 314 | testfillrects(BLUE, YELLOW); 315 | delay(1000); 316 | 317 | randomRect(0); 318 | delay(100); 319 | randomCircles(0); 320 | delay(100); 321 | randomLines(); 322 | delay(100); 323 | randomPoints(); 324 | delay(500); 325 | 326 | tft.clearScreen(); 327 | testfillcircles(10, BLUE); 328 | testdrawcircles(10, WHITE); 329 | delay(1000); 330 | 331 | testroundrects(); 332 | delay(500); 333 | 334 | testtriangles(); 335 | delay(500); 336 | 337 | } 338 | 339 | void loop() { 340 | testlines(random(0x0010,0xFFFF)); 341 | randomLines(); 342 | //randomCircles(1); 343 | randomCircles(0); 344 | randomRect(1); 345 | randomRect(1); 346 | randomRect(1); 347 | randomRect(1); 348 | randomRect(1); 349 | randomRect(0); 350 | randomRect(0); 351 | randomRect(0); 352 | randomRect(0); 353 | randomRect(0); 354 | randomRect(0); 355 | randomPoints(); 356 | } 357 | -------------------------------------------------------------------------------- /examples/bubbles/bubbles.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example was adapted from ugfx http://ugfx.org 3 | It's a great example of many 2d objects in a 3d space (matrix transformations) 4 | */ 5 | #ifdef __AVR__ 6 | #define sinf sin 7 | #endif 8 | 9 | #include 10 | #include 11 | 12 | 13 | #define NDOTS 256 // Number of dots 512 14 | #define SCALE 4096 //4096 15 | #define INCREMENT 512//512 16 | #define PI2 6.283185307179586476925286766559 17 | #define RED_COLORS (32) 18 | #define GREEN_COLORS (64) 19 | #define BLUE_COLORS (32) 20 | 21 | /* 22 | Teensy3.x and Arduino's 23 | You are using 4 wire SPI here, so: 24 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 25 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 26 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 27 | ESP8266----------------------------------- 28 | Use: 29 | #define __CS 16 //(D0) 30 | #define __DC 5 //(D1) 31 | #define __RST 4 //(D2) 32 | 33 | SCLK:D5 34 | MOSI:D7 35 | */ 36 | #define __CS1 10 37 | #define __DC 9 38 | 39 | 40 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 41 | 42 | int16_t sine[SCALE+(SCALE/4)]; 43 | int16_t *cosi = &sine[SCALE/4]; 44 | int16_t angleX = 0, angleY = 0, angleZ = 0; 45 | int16_t speedX = 0, speedY = 0, speedZ = 0; 46 | 47 | int16_t xyz[3][NDOTS]; 48 | uint16_t col[NDOTS]; 49 | int pass = 0; 50 | 51 | 52 | void initialize (void){ 53 | uint16_t i; 54 | /* if you change the SCALE*1.25 back to SCALE, the program will 55 | * occassionally overrun the cosi array -- however this actually 56 | * produces some interesting effects as the BUBBLES LOSE CONTROL!!!! 57 | */ 58 | for (i = 0; i < SCALE+(SCALE/4); i++) 59 | //sine[i] = (-SCALE/2) + (int)(sinf(PI2 * i / SCALE) * sinf(PI2 * i / SCALE) * SCALE); 60 | sine[i] = (int)(sinf(PI2 * i / SCALE) * SCALE); 61 | } 62 | 63 | void setup() 64 | { 65 | tft.begin(); 66 | initialize(); 67 | } 68 | 69 | 70 | 71 | void matrix (int16_t xyz[3][NDOTS], uint16_t col[NDOTS]){ 72 | static uint32_t t = 0; 73 | int16_t x = -SCALE, y = -SCALE; 74 | uint16_t i, s, d; 75 | uint8_t red,grn,blu; 76 | 77 | for (i = 0; i < NDOTS; i++) 78 | { 79 | xyz[0][i] = x; 80 | xyz[1][i] = y; 81 | 82 | d = sqrt(x * x + y * y); /* originally a fastsqrt() call */ 83 | s = sine[(t * 30) % SCALE] + SCALE; 84 | 85 | xyz[2][i] = sine[(d + s) % SCALE] * sine[(t * 10) % SCALE] / SCALE / 2; 86 | 87 | red = (cosi[xyz[2][i] + SCALE / 2] + SCALE) * (RED_COLORS - 1) / SCALE / 2; 88 | grn = (cosi[(xyz[2][i] + SCALE / 2 + 2 * SCALE / 3) % SCALE] + SCALE) * (GREEN_COLORS - 1) / SCALE / 2; 89 | blu = (cosi[(xyz[2][i] + SCALE / 2 + SCALE / 3) % SCALE] + SCALE) * (BLUE_COLORS - 1) / SCALE / 2; 90 | col[i] = ((red << 11) + (grn << 5) + blu); 91 | x += INCREMENT; 92 | if (x >= SCALE) x = -SCALE, y += INCREMENT; 93 | } 94 | t++; 95 | } 96 | 97 | void rotate (int16_t xyz[3][NDOTS], uint16_t angleX, uint16_t angleY, uint16_t angleZ){ 98 | uint16_t i; 99 | int16_t tmpX, tmpY; 100 | int16_t sinx = sine[angleX], cosx = cosi[angleX]; 101 | int16_t siny = sine[angleY], cosy = cosi[angleY]; 102 | int16_t sinz = sine[angleZ], cosz = cosi[angleZ]; 103 | 104 | for (i = 0; i < NDOTS; i++) 105 | { 106 | tmpX = (xyz[0][i] * cosx - xyz[2][i] * sinx) / SCALE; 107 | xyz[2][i] = (xyz[0][i] * sinx + xyz[2][i] * cosx) / SCALE; 108 | xyz[0][i] = tmpX; 109 | tmpY = (xyz[1][i] * cosy - xyz[2][i] * siny) / SCALE; 110 | xyz[2][i] = (xyz[1][i] * siny + xyz[2][i] * cosy) / SCALE; 111 | xyz[1][i] = tmpY; 112 | tmpX = (xyz[0][i] * cosz - xyz[1][i] * sinz) / SCALE; 113 | xyz[1][i] = (xyz[0][i] * sinz + xyz[1][i] * cosz) / SCALE; 114 | xyz[0][i] = tmpX; 115 | } 116 | } 117 | 118 | 119 | void draw(int16_t xyz[3][NDOTS], uint16_t col[NDOTS]){ 120 | static uint16_t oldProjX[NDOTS] = { 0 }; 121 | static uint16_t oldProjY[NDOTS] = { 0 }; 122 | static uint8_t oldDotSize[NDOTS] = { 0 }; 123 | uint16_t i, projX, projY, projZ, dotSize; 124 | 125 | for (i = 0; i < NDOTS; i++) 126 | { 127 | projZ = SCALE - (xyz[2][i] + SCALE) / 4; 128 | projX = tft.width() / 2 + (xyz[0][i] * projZ / SCALE) / 25; 129 | projY = tft.height() / 2 + (xyz[1][i] * projZ / SCALE) / 25; 130 | dotSize = 3 - (xyz[2][i] + SCALE) * 2 / SCALE; 131 | 132 | tft.drawCircle (oldProjX[i], oldProjY[i], oldDotSize[i], BLACK); 133 | 134 | if (projX > dotSize && projY > dotSize && projX < tft.width() - dotSize && projY < tft.height() - dotSize) 135 | { 136 | tft.drawCircle (projX, projY, dotSize, col[i]); 137 | oldProjX[i] = projX; 138 | oldProjY[i] = projY; 139 | oldDotSize[i] = dotSize; 140 | } 141 | } 142 | } 143 | 144 | void loop() 145 | { 146 | matrix(xyz, col); 147 | rotate(xyz, angleX, angleY, angleZ); 148 | draw(xyz, col); 149 | 150 | angleX += speedX; 151 | angleY += speedY; 152 | angleZ += speedZ; 153 | 154 | if (pass > 400) speedY = 1; 155 | if (pass > 800) speedX = 1; 156 | if (pass > 1200) speedZ = 1; 157 | pass++; 158 | 159 | if (angleX >= SCALE) { 160 | angleX -= SCALE; 161 | } 162 | else if (angleX < 0) { 163 | angleX += SCALE; 164 | } 165 | 166 | if (angleY >= SCALE) { 167 | angleY -= SCALE; 168 | } 169 | else if (angleY < 0) { 170 | angleY += SCALE; 171 | } 172 | 173 | if (angleZ >= SCALE) { 174 | angleZ -= SCALE; 175 | } 176 | else if (angleZ < 0) { 177 | angleZ += SCALE; 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /examples/char_remap_example/char_remap_example.ino: -------------------------------------------------------------------------------- 1 | /* 2 | An example of a font that use char remap: 3 | akasha_cap has only this chars +,-.0123456789:<=>?ABCDEFGHIJKLMNOPQRSTUVWXY 4 | but it has remap flag enabled to 1. 5 | Inside akasha_cap.c, at the end, this line: 6 | const tFont akasha_cap = { 45, akasha_cap_array,0,11, RLE_no, 1 }; 7 | the last parameter is set to 1, this force library to remap of all minus to CAPITALs 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include "_fonts/akasha_cap.c" 14 | 15 | 16 | #if defined(ESP8266) 17 | #define __CS1 16 //(D0) 18 | #define __CS2 4 //(D2) 19 | #define __DC 5 //(D1) 20 | #else 21 | #define __CS1 10 22 | #define __DC 9 23 | #endif 24 | 25 | 26 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 27 | 28 | 29 | void setup() 30 | { 31 | tft1.begin(); 32 | tft1.setRotation(0); 33 | tft1.setFont(&akasha_cap); 34 | tft1.print("abc ABC"); 35 | } 36 | 37 | void loop() 38 | { 39 | 40 | } 41 | -------------------------------------------------------------------------------- /examples/drawLineAngle_example/drawLineAngle_example.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Draw Line Angle Example 3 | Library has a nice function called drawLineAngle 4 | that let you draw easily needle gauges at any angle 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #define __CS1 10 11 | #define __DC 9 12 | 13 | 14 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 15 | 16 | 17 | 18 | void setup() { 19 | 20 | tft.begin(); 21 | tft.drawCircle(tft.height()/2, tft.height() / 2, tft.height() / 2-4, 0xFFFF);//draw round gauge 22 | tft.drawCircle(tft.height() / 2, tft.height() / 2, tft.height() / 2-5, 0xFFFF);//draw round gauge 23 | } 24 | 25 | void loop() { 26 | for (int i = 0; i <= 360; i++) { 27 | if (i > 0) tft.drawLineAngle(tft.height() / 2, tft.height() / 2, i - 1, tft.height() / 2-6, 0x0000);//erase previous needle 28 | tft.drawLineAngle(tft.height() / 2, tft.height() / 2, i, tft.height() / 2-6, GREEN);//draw needle 29 | delay(10); 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /examples/externalFonts/externalFonts.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This sketch shows how to use other fonts 3 | and some new text commands 4 | 5 | */ 6 | #include 7 | #include 8 | #include "_fonts/unborn_small.c" 9 | 10 | 11 | #define __CS 10 12 | #define __DC 9 13 | 14 | SSD_13XX tft = SSD_13XX(__CS, __DC);//we dont use rst, tie reset pin to 3v3 15 | 16 | void setup() { 17 | Serial.begin(115200); 18 | Serial.print("\nstarted\n"); 19 | tft.begin(); 20 | /* 21 | after this command the library has already set several 22 | things as default: 23 | tft.clearScreen();//screen cleared with black 24 | tft.setRotation(0);//no rotation 25 | tft.setTextScale(1);//no scale 26 | tft.setCursor(0,0); 27 | tft.setTextWrap(true);//text will wrap to a new line automatically 28 | tft.setTextColor(WHITE,WHITE);//background transparent 29 | //default internal font loaded arial_x2 30 | This allow you to start writing immediately without 31 | need to set anything. 32 | */ 33 | tft.setFont(&unborn_small);//this will load the font 34 | tft.println("Hello world!");//this will add a new line as well 35 | tft.setTextScale(3);//now multiply x 3 the scale 36 | tft.println("Hello world!");//the wrap on will split words in 2 lines 37 | tft.setInternalFont();//now switch to internal font 38 | tft.setTextScale(2);//smaller 39 | tft.setFontInterline(2);//this will be active after the println! 40 | tft.println("Hello world!"); 41 | tft.setCharSpacing(1);//add an extra pixel between chars 42 | tft.setTextColor(WHITE, BLUE); //set a background inside font 43 | tft.println("Hello world!"); 44 | } 45 | 46 | void loop() { 47 | 48 | } -------------------------------------------------------------------------------- /examples/graphictest/graphictest.ino: -------------------------------------------------------------------------------- 1 | /*************************************************** 2 | This is our GFX example for the Adafruit ILI9341 Breakout and Shield 3 | ----> http://www.adafruit.com/products/1651 4 | 5 | Check out the links above for our tutorials and wiring diagrams 6 | These displays use SPI to communicate, 4 or 5 pins are required to 7 | interface (RST is optional) 8 | Adafruit invests time and resources providing this open source code, 9 | please support Adafruit and open-source hardware by purchasing 10 | products from Adafruit! 11 | 12 | Written by Limor Fried/Ladyada for Adafruit Industries. 13 | MIT license, all text above must be included in any redistribution 14 | NOTE: This version is the same of the ILI9340_t3 library 15 | here just for testing... 16 | ****************************************************/ 17 | 18 | 19 | #include 20 | #include 21 | 22 | // For the Adafruit shield, these are the default. 23 | #define TFT_DC 9 24 | #define TFT_CS 10 25 | 26 | uint8_t errorCode = 0; 27 | 28 | SSD_13XX tft = SSD_13XX(TFT_CS, TFT_DC); 29 | 30 | void setup() { 31 | Serial.begin(38400); 32 | long unsigned debug_start = millis(); 33 | while (!Serial && ((millis() - debug_start) <= 5000)); 34 | tft.begin(false); 35 | delay(30); 36 | //the following it's mainly for Teensy 37 | //it will help you to understand if you have choosed the 38 | //wrong combination of pins! 39 | errorCode = tft.getErrorCode(); 40 | if (errorCode != 0) { 41 | Serial.print("Init error! "); 42 | if (bitRead(errorCode, 0)) Serial.print("MOSI or SCLK pin mismach!\n"); 43 | if (bitRead(errorCode, 1)) Serial.print("CS or DC pin mismach!\n"); 44 | } 45 | else { 46 | Serial.println(F("Benchmark Sketch V1.1")); 47 | tft.setTextColor(YELLOW); 48 | tft.setTextScale(2); 49 | } 50 | } 51 | 52 | 53 | void loop(void) { 54 | if (errorCode == 0) { 55 | for (uint8_t rotation = 0; rotation < 4; rotation++) { 56 | tft.setRotation(rotation); 57 | Serial.println(F("Benchmark Time (microseconds)")); 58 | 59 | Serial.print(F("Screen fill ")); 60 | Serial.println(testFillScreen()); 61 | delay(200); 62 | 63 | Serial.print(F("Text ")); 64 | Serial.println(testText()); 65 | delay(600); 66 | 67 | Serial.print(F("Lines ")); 68 | Serial.println(testLines(CYAN)); 69 | delay(200); 70 | 71 | Serial.print(F("Horiz/Vert Lines ")); 72 | Serial.println(testFastLines(RED, BLUE)); 73 | delay(200); 74 | 75 | Serial.print(F("Rectangles (outline) ")); 76 | Serial.println(testRects(GREEN)); 77 | delay(200); 78 | 79 | Serial.print(F("Rectangles (filled) ")); 80 | Serial.println(testFilledRects(YELLOW, MAGENTA)); 81 | delay(200); 82 | 83 | Serial.print(F("Circles (filled) ")); 84 | Serial.println(testFilledCircles(10, MAGENTA)); 85 | 86 | Serial.print(F("Circles (outline) ")); 87 | Serial.println(testCircles(10, WHITE)); 88 | delay(200); 89 | 90 | Serial.print(F("Triangles (outline) ")); 91 | Serial.println(testTriangles()); 92 | delay(200); 93 | 94 | Serial.print(F("Triangles (filled) ")); 95 | Serial.println(testFilledTriangles()); 96 | delay(200); 97 | 98 | Serial.print(F("Rounded rects (outline) ")); 99 | Serial.println(testRoundRects()); 100 | delay(200); 101 | 102 | Serial.print(F("Rounded rects (filled) ")); 103 | Serial.println(testFilledRoundRects()); 104 | delay(200); 105 | 106 | Serial.println(F("Done!")); 107 | delay(1000); 108 | } 109 | } 110 | } 111 | 112 | unsigned long testFillScreen() { 113 | unsigned long start = micros(); 114 | tft.fillScreen(BLACK); 115 | tft.fillScreen(RED); 116 | tft.fillScreen(GREEN); 117 | tft.fillScreen(BLUE); 118 | tft.fillScreen(BLACK); 119 | return micros() - start; 120 | } 121 | 122 | unsigned long testText() { 123 | tft.clearScreen(); 124 | unsigned long start = micros(); 125 | tft.setCursor(0, 0); 126 | tft.setTextColor(WHITE); tft.setTextScale(1); 127 | tft.println("Hello World!"); 128 | tft.setTextColor(YELLOW); tft.setTextScale(2); 129 | tft.println(1234.56); 130 | tft.setTextColor(RED); tft.setTextScale(3); 131 | tft.println(0xDEADBEEF, HEX); 132 | tft.println(); 133 | tft.setTextColor(GREEN); 134 | tft.setTextScale(5); 135 | tft.println("Groop"); 136 | tft.setTextScale(2); 137 | tft.println("I implore thee,"); 138 | tft.setTextScale(1); 139 | tft.println("my foonting turlingdromes."); 140 | tft.println("And hooptiously drangle me"); 141 | tft.println("with crinkly bindlewurdles,"); 142 | tft.println("Or I will rend thee"); 143 | tft.println("in the gobberwarts"); 144 | tft.println("with my blurglecruncheon,"); 145 | tft.println("see if I don't!"); 146 | return micros() - start; 147 | } 148 | 149 | unsigned long testLines(uint16_t color) { 150 | unsigned long start, t; 151 | int x1, y1, x2, y2, 152 | w = tft.width(), 153 | h = tft.height(); 154 | 155 | tft.clearScreen(); 156 | 157 | x1 = y1 = 0; 158 | y2 = h - 1; 159 | start = micros(); 160 | for(x2=0; x20; i-=6) { 238 | i2 = i / 2; 239 | start = micros(); 240 | tft.fillRect(cx-i2, cy-i2, i, i, color1); 241 | t += micros() - start; 242 | // Outlines are not included in timing results 243 | tft.drawRect(cx-i2, cy-i2, i, i, color2); 244 | } 245 | 246 | return t; 247 | } 248 | 249 | unsigned long testFilledCircles(uint8_t radius, uint16_t color) { 250 | unsigned long start; 251 | int x, y, w = tft.width(), h = tft.height(), r2 = radius * 2; 252 | 253 | tft.clearScreen(); 254 | start = micros(); 255 | for(x=radius; x10; i-=5) { 309 | start = micros(); 310 | tft.fillTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 311 | tft.Color565(0, i, i)); 312 | t += micros() - start; 313 | tft.drawTriangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, 314 | tft.Color565(i, i, 0)); 315 | } 316 | 317 | return t; 318 | } 319 | 320 | unsigned long testRoundRects() { 321 | unsigned long start; 322 | int w, i, i2, 323 | cx = tft.width() / 2 - 1, 324 | cy = tft.height() / 2 - 1; 325 | 326 | tft.clearScreen(); 327 | w = min(tft.width(), tft.height()); 328 | start = micros(); 329 | for(i=0; i20; i-=6) { 346 | i2 = i / 2; 347 | tft.fillRoundRect(cx-i2, cy-i2, i, i, i/8, tft.Color565(0, i, 0)); 348 | } 349 | 350 | return micros() - start; 351 | } 352 | -------------------------------------------------------------------------------- /examples/icon_inverse/icon_inverse.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Icons are flexible! Here's a negative image colored as positive 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "_icons/wifi.c" 9 | 10 | 11 | #define __CS1 10 12 | #define __DC 9 13 | 14 | 15 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 16 | 17 | 18 | void setup() 19 | { 20 | tft1.begin(); 21 | tft1.setRotation(0); 22 | } 23 | 24 | void loop() 25 | { 26 | uint16_t color = random(0x00FF, 0xFFFF); 27 | tft1.drawIcon(0, 0, &wifi, 1, color, color, true); 28 | delay(50); 29 | } -------------------------------------------------------------------------------- /examples/icon_simple/icon_simple.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "_icons/wifi.c" 5 | 6 | 7 | #define __CS1 10 8 | #define __DC 9 9 | 10 | 11 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 12 | 13 | 14 | void setup() 15 | { 16 | tft1.begin(); 17 | tft1.setRotation(0); 18 | tft1.drawIcon(0, 0, &wifi); 19 | } 20 | 21 | void loop() 22 | { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /examples/icon_simple2/icon_simple2.ino: -------------------------------------------------------------------------------- 1 | /* 2 | A simple example, loads 2 icons and colorize 3 | */ 4 | 5 | #include 6 | #include 7 | 8 | #include "_icons/spkOn.c" 9 | #include "_icons/spkOff.c" 10 | 11 | 12 | #if defined(ESP8266) 13 | #define __CS1 16 //(D0) 14 | #define __CS2 4 //(D2) 15 | #define __DC 5 //(D1) 16 | #else 17 | #define __CS1 10//10 18 | #define __DC 9 19 | #endif 20 | 21 | 22 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 23 | 24 | 25 | 26 | void setup() 27 | { 28 | 29 | tft1.begin(); 30 | tft1.setRotation(0); 31 | 32 | } 33 | 34 | void loop() 35 | { 36 | tft1.drawIcon(0, 0, &spkOn, 1, GREEN, BLACK, true); 37 | delay(250); 38 | tft1.drawIcon(0, 0, &spkOff, 1, RED, BLACK, true); 39 | delay(250); 40 | } 41 | -------------------------------------------------------------------------------- /examples/image_background/Debug/image_background.ino.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sumotoy/SSD_13XX/aed648a0430a1cdd9c4c2512f7971b0dddaeb26f/examples/image_background/Debug/image_background.ino.elf -------------------------------------------------------------------------------- /examples/image_background/__vm/.image_background.vsarduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Editor: http://www.visualmicro.com 3 | visual micro and the arduino ide ignore this code during compilation. this code is automatically maintained by visualmicro, manual changes to this file will be overwritten 4 | the contents of the Visual Micro sketch sub folder can be deleted prior to publishing a project 5 | all non-arduino files created by visual micro and all visual studio project or solution files can be freely deleted and are not required to compile a sketch (do not delete your own code!). 6 | note: debugger breakpoints are stored in '.sln' or '.asln' files, knowledge of last uploaded breakpoints is stored in the upload.vmps.xml file. Both files are required to continue a previous debug session without needing to compile and upload again 7 | 8 | Hardware: Teensy 3.2 / 3.1, Platform=teensy3, Package=teensy 9 | */ 10 | 11 | #ifndef _VSARDUINO_H_ 12 | #define _VSARDUINO_H_ 13 | #define __HARDWARE_MK20dx256__ 14 | #define __HARDWARE_MK20DX256__ 15 | #define __MK20DX256__ 16 | #define TEENSYDUINO 129 17 | #define ARDUINO 10609 18 | #define F_CPU 96000000 19 | #define USB_SERIAL 20 | #define LAYOUT_US_ENGLISH 21 | #define __cplusplus 201103L 22 | #define __arm__ 23 | #define __ARM__ 24 | #define __extension__ 25 | #define __attribute__(x) 26 | typedef void *__builtin_va_list; 27 | #define __extension__ 28 | #define __ATTR_PURE__ 29 | #define __ATTR_CONST__ 30 | #define __inline__ 31 | #define __asm__ 32 | #define __volatile__ 33 | #define _HAVE_STDC 34 | 35 | #define NEW_H 36 | 37 | #include 38 | #define __arm__ 39 | #define __ARM__ 40 | #define __extension__ 41 | #define __attribute__(x) 42 | typedef void *__builtin_va_list; 43 | #define __extension__ 44 | #define __ATTR_PURE__ 45 | #define __ATTR_CONST__ 46 | #define __inline__ 47 | #define __asm__ 48 | #define __volatile__ 49 | 50 | #define __disable_irq() __asm__ volatile(""); 51 | #define __enable_irq() __asm__ volatile(""); 52 | 53 | 54 | #define NEW_H 55 | #include 56 | #endif 57 | -------------------------------------------------------------------------------- /examples/image_background/image_background.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Images are flexible! Here's an example that cut the Image background color and set as transparent! 3 | Caution: This will not run on Arduino UNO or similar, image is too big! 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "_images/machine.c" 10 | 11 | 12 | #if defined(ESP8266) 13 | #define __CS1 16 //(D0) 14 | #define __CS2 4 //(D2) 15 | #define __DC 5 //(D1) 16 | #else 17 | #define __CS1 10//10 18 | #define __DC 9 19 | #endif 20 | 21 | 22 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 23 | 24 | void setup() 25 | { 26 | tft1.begin(); 27 | tft1.setRotation(0); 28 | // 29 | /* 30 | drawImages parameters: 31 | ------------------------------------------- 32 | x: origin on x 33 | y: origin on Y 34 | &image: the image 35 | ---------- following are optional ------ 36 | imageMode:NONE,TRANSPARENT,REPLACE,BOTH 37 | background color threshold:0x000 to 0xFFFF (not used if imageMode set to NONE) 38 | -------------------------------------------- 39 | drawImages has a couple of optional parameters 40 | NONE,TRANSPARENT,REPLACE,BOTH 41 | background threshold. 42 | When set to NONE, the image will be processed as is. 43 | When set to TRANSPARENT, the image will ignore all pixels equal or less than choosed background threshold 44 | When set to REPLACE, the choosed background threshold will be replaced by current background (by using setBackground(color)) 45 | When set to BOTH, the choosed background threshold will be replaced by current background (by using setBackground), all other pixels 46 | will be replaced by Foregound color (set by setForeground(color))! 47 | >>> --------- NOTE: If your image is too wide or tall (included positions x,y) you will see nothing! ------------- <<< 48 | */ 49 | } 50 | 51 | void loop() 52 | { 53 | tft1.fillScreen(RED, BLUE); 54 | tft1.drawImage(0, 0, &machine); 55 | delay(3000); 56 | tft1.fillScreen(RED, BLUE); 57 | tft1.drawImage(0, 0, &machine, TRANSPARENT, 0x19FF); 58 | delay(3000); 59 | tft1.fillScreen(RED); 60 | tft1.setBackground(RED); 61 | tft1.drawImage(0, 0, &machine, REPLACE, 0x0011);//colors under 0x00FF will be replaced by RED 62 | delay(3000); 63 | tft1.fillScreen(RED); 64 | tft1.setBackground(RED); 65 | tft1.setForeground(CYAN); 66 | tft1.drawImage(0, 0, &machine, BOTH, 0x0001); 67 | delay(3000); 68 | } -------------------------------------------------------------------------------- /examples/image_background/image_background.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {ABA78EAE-C36C-48E8-BBB4-BF91FB11CEC0} 23 | image_background 24 | 8.1 25 | 26 | 27 | 28 | Application 29 | true 30 | v140 31 | MultiByte 32 | 33 | 34 | Application 35 | false 36 | v140 37 | true 38 | MultiByte 39 | 40 | 41 | Application 42 | true 43 | v140 44 | MultiByte 45 | 46 | 47 | Application 48 | false 49 | v140 50 | true 51 | MultiByte 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | Level3 75 | Disabled 76 | true 77 | 78 | 79 | 80 | 81 | Level3 82 | Disabled 83 | true 84 | 85 | 86 | 87 | 88 | Level3 89 | MaxSpeed 90 | true 91 | true 92 | true 93 | 94 | 95 | true 96 | true 97 | 98 | 99 | 100 | 101 | Level3 102 | MaxSpeed 103 | true 104 | true 105 | true 106 | 107 | 108 | true 109 | true 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /examples/image_background/image_background.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/image_eyeAnimation/image_eyeAnimation.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Brrr...It's alive! 3 | CAUTION: Too big for arduino UNO or similar... 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "_images/eye/eye0.c" 10 | #include "_images/eye/eye1.c" 11 | #include "_images/eye/eye2.c" 12 | #include "_images/eye/eye3.c" 13 | #include "_images/eye/eye4.c" 14 | #include "_images/eye/eye5.c" 15 | #include "_images/eye/eye6.c" 16 | #include "_images/eye/eye7.c" 17 | #include "_images/eye/eye8.c" 18 | #include "_images/eye/eye9.c" 19 | #include "_images/eye/eye10.c" 20 | #include "_images/eye/eye11.c" 21 | #include "_images/eye/eye12.c" 22 | #include "_images/eye/eye13.c" 23 | #include "_images/eye/eye14.c" 24 | #include "_images/eye/eye15.c" 25 | #include "_images/eye/eye16.c" 26 | #include "_images/eye/eye17.c" 27 | #include "_images/eye/eye93.c" 28 | 29 | const tPicture animation[19] = { 30 | eye0, eye1, eye2, eye3, eye4, eye5, eye6, eye7, 31 | eye8, eye9, eye10, eye11, eye12, eye13, eye14, eye15, eye16, 32 | eye17, eye93 33 | }; 34 | 35 | 36 | #define __CS1 10 37 | #define __DC 9 38 | 39 | 40 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 41 | 42 | 43 | void setup() 44 | { 45 | tft1.begin(); 46 | } 47 | 48 | void loop() 49 | { 50 | for (int i = 0; i < 19; i++) { 51 | tft1.clearScreen(); 52 | tft1.drawImage(0, 0, &animation[i]); 53 | tft1.drawImage(47, 0, &animation[i]); 54 | delay(50); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /examples/image_simple/image_simple.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "_images/sw1.c" 5 | 6 | 7 | 8 | 9 | #define __CS1 10 10 | #define __DC 9 11 | 12 | 13 | SSD_13XX tft1 = SSD_13XX(__CS1, __DC); 14 | 15 | 16 | void setup() 17 | { 18 | tft1.begin(); 19 | tft1.setRotation(0); 20 | tft1.drawImage(0, 0, &sw1); 21 | } 22 | 23 | void loop() 24 | { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /examples/ringMeterExample/ringMeterExample.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This is a test for the ringMeter function created by Alan Senior 3 | and adapted for this library... 4 | Use at your risk and pleasure, I will gonna modify this soon. 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | #define __CS1 10 11 | #define __DC 9 12 | 13 | uint32_t runTime = -99999; // time for next update 14 | int reading = 0; // Value to be displayed 15 | int d = 0; // Variable used for the sinewave test waveform 16 | 17 | 18 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 19 | 20 | 21 | void setup() { 22 | tft.begin(); 23 | } 24 | 25 | void loop() { 26 | if (millis() - runTime >= 100L) { // Execute every 2s 27 | runTime = millis(); 28 | // Test with a slowly changing value from a Sine function 29 | d += 5; 30 | if (d >= 360) d = 0; 31 | // Set the the position, gap between meters, and inner radius of the meters 32 | // Test with Sine wave function, normally reading will be from a sensor 33 | reading = 1000 + 150 * sineWave(d + 90); 34 | tft.ringMeter(reading, 850, 1150, 0, 0, 20, 3, BLACK, 150, 5); 35 | reading = 250 + 250 * sineWave(d); 36 | tft.ringMeter(reading, 0, 300, 50, 0, 20, 4, BLACK, 150, 5); 37 | reading = 15 + 15 * sineWave(d + 150); 38 | tft.ringMeter(reading, 0, 30, 0, 50, 20, 6, DARK_GREY, 90, 5); 39 | } 40 | } 41 | 42 | float sineWave(int phase) { 43 | return sin(phase * 0.0174532925); 44 | } -------------------------------------------------------------------------------- /examples/roundGaugeWithBallistic/roundGaugeWithBallistic.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ROUND GAUGE EXAMPLE with ballistic! 3 | This example show how to create a round gauge that react like the real one with (almost) correct ballistic 4 | Created by S.U.M.O.T.O.Y - Max MC Costa 5 | If you modify or get better result please let me know 6 | */ 7 | #include 8 | #include 9 | 10 | 11 | 12 | volatile int16_t curVal1 = 0; 13 | volatile int16_t oldVal1 = 0; 14 | 15 | /* 16 | Teensy3.x and Arduino's 17 | You are using 4 wire SPI here, so: 18 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 19 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 20 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 21 | ESP8266----------------------------------- 22 | Use: 23 | #define __CS 16 //(D0) 24 | #define __DC 5 //(D1) 25 | #define __RST 4 //(D2) 26 | 27 | SCLK:D5 28 | MOSI:D7 29 | */ 30 | #define __CS 10 31 | #define __DC 9 32 | 33 | #define _GAUGEDIM 31 34 | 35 | /* 36 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 37 | Arduino's 8 bit: any 38 | DUE: check arduino site 39 | If you do not use reset, tie it to +3V3 40 | */ 41 | 42 | 43 | SSD_13XX tft = SSD_13XX(__CS, __DC); 44 | 45 | 46 | void setup() { 47 | Serial.begin(9600); 48 | tft.begin(); 49 | drawGauge(_GAUGEDIM, _GAUGEDIM, _GAUGEDIM); 50 | } 51 | 52 | void loop(void) { 53 | curVal1 = random(1, 254); 54 | if (oldVal1 != curVal1) { 55 | drawNeedle(curVal1, _GAUGEDIM, _GAUGEDIM, _GAUGEDIM, GREEN, BLACK); 56 | oldVal1 = curVal1; 57 | } 58 | } 59 | 60 | void drawGauge(uint8_t x, uint8_t y, uint8_t r) { 61 | tft.drawCircle(x, y, r, WHITE); //draw instrument container 62 | faceHelper(x, y, r, 150, 390, 1.3); //draw major ticks 63 | if (r > 15) faceHelper(x, y, r, 165, 375, 1.1); //draw minor ticks 64 | 65 | } 66 | 67 | void faceHelper(uint8_t x, uint8_t y, uint8_t r, int from, int to, float dev) { 68 | float dsec, fromSecX, fromSecY, toSecX, toSecY; 69 | int i; 70 | for (i = from; i <= to; i += 30) { 71 | dsec = i * (PI / 180); 72 | fromSecX = cos(dsec) * (r / dev); 73 | fromSecY = sin(dsec) * (r / dev); 74 | toSecX = cos(dsec) * r; 75 | toSecY = sin(dsec) * r; 76 | tft.drawLine(1 + x + fromSecX, 1 + y + fromSecY, 1 + x + toSecX, 1 + y + toSecY, WHITE); 77 | } 78 | } 79 | 80 | void drawNeedle(int16_t val, uint8_t x, uint8_t y, uint8_t r, uint16_t color, uint16_t bcolor) { 81 | uint8_t i; 82 | if (curVal1 > oldVal1) { 83 | for (i = oldVal1; i <= curVal1; i++) { 84 | drawPointerHelper(i - 1, _GAUGEDIM, _GAUGEDIM, _GAUGEDIM, bcolor); 85 | drawPointerHelper(i, _GAUGEDIM, _GAUGEDIM, _GAUGEDIM, color); 86 | if ((curVal1 - oldVal1) < (128)) delay(1);//ballistic 87 | } 88 | } 89 | else { 90 | for (i = oldVal1; i >= curVal1; i--) { 91 | drawPointerHelper(i + 1, _GAUGEDIM, _GAUGEDIM, _GAUGEDIM, bcolor); 92 | drawPointerHelper(i, _GAUGEDIM, _GAUGEDIM, _GAUGEDIM, color); 93 | //ballistic 94 | if ((oldVal1 - curVal1) >= 128) { 95 | delay(1); 96 | } else { 97 | delay(3); 98 | } 99 | } 100 | } 101 | } 102 | 103 | void drawPointerHelper(int16_t val, uint8_t x, uint8_t y, uint8_t r, uint16_t color) { 104 | float dsec, toSecX, toSecY; 105 | int16_t minValue = 0; 106 | int16_t maxValue = 255; 107 | int fromDegree = 150;//start 108 | int toDegree = 240;//end 109 | if (val > maxValue) val = maxValue; 110 | if (val < minValue) val = minValue; 111 | dsec = (((float)(uint16_t)(val - minValue) / (float)(uint16_t)(maxValue - minValue) * toDegree) + fromDegree) * (PI / 180); 112 | toSecX = cos(dsec) * (r / 1.35); 113 | toSecY = sin(dsec) * (r / 1.35); 114 | tft.drawLine(x, y, 1 + x + toSecX, 1 + y + toSecY, color); 115 | tft.fillCircle(x, y, 2, color); 116 | } 117 | 118 | -------------------------------------------------------------------------------- /examples/textCentering/textCentering.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* 5 | Teensy3.x and Arduino's 6 | You are using 4 wire SPI here, so: 7 | MOSI: 11//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 8 | MISO: 12//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 9 | SCK: 13//Teensy3.x/Arduino UNO (for MEGA/DUE refere to arduino site) 10 | ESP8266----------------------------------- 11 | Use: 12 | #define __CS 16 //(D0) 13 | #define __DC 5 //(D1) 14 | #define __RST 4 //(D2) 15 | 16 | SCLK:D5 17 | MOSI:D7 18 | */ 19 | #if defined(ESP8266) 20 | #define __CS1 16 //(D0) 21 | #define __CS2 4 //(D2) 22 | #define __DC 5 //(D1) 23 | #else 24 | #define __CS1 10//10 25 | #define __DC 9 26 | #endif 27 | /* 28 | Teensy 3.x can use: 2,6,10,15,20,21,22,23 29 | Arduino's 8 bit: any 30 | DUE: check arduino site 31 | If you do not use reset, tie it to +3V3 32 | */ 33 | 34 | 35 | SSD_13XX tft = SSD_13XX(__CS1, __DC); 36 | 37 | 38 | 39 | 40 | 41 | void setup() { 42 | /* 43 | Serial.begin(38400); 44 | long unsigned debug_start = millis(); 45 | while (!Serial && ((millis() - debug_start) <= 5000)); 46 | */ 47 | tft.begin(); 48 | } 49 | 50 | void centerText1(uint8_t rot) 51 | { 52 | tft.clearScreen(); 53 | if (rot == 0) { 54 | tft.setTextScale(0); 55 | tft.setCursor(CENTER, CENTER); 56 | tft.print("X Centered"); 57 | delay(1000); 58 | tft.clearScreen(); 59 | } 60 | tft.setTextScale(3); 61 | tft.setRotation(rot); 62 | tft.setCursor(CENTER, 0); 63 | tft.print("AB"); 64 | } 65 | 66 | void centerText2(uint8_t rot) 67 | { 68 | tft.clearScreen(); 69 | tft.setRotation(rot); 70 | if (rot == 0) { 71 | tft.setTextScale(0); 72 | tft.setCursor(CENTER, CENTER); 73 | tft.print("Y Centered"); 74 | delay(1000); 75 | tft.clearScreen(); 76 | } 77 | tft.setTextScale(2); 78 | tft.setCursor(0, CENTER); 79 | tft.print("AB"); 80 | } 81 | 82 | void centerText3(uint8_t rot) 83 | { 84 | tft.clearScreen(); 85 | tft.setRotation(rot); 86 | if (rot == 0) { 87 | tft.setTextScale(0); 88 | tft.setCursor(CENTER, CENTER); 89 | tft.print("XY Centered"); 90 | delay(1000); 91 | tft.clearScreen(); 92 | } 93 | tft.setTextScale(3); 94 | tft.setCursor(CENTER, CENTER); 95 | tft.print("AB"); 96 | } 97 | 98 | void buttonDemo(uint8_t rot) 99 | { 100 | tft.clearScreen(); 101 | tft.setRotation(rot); 102 | if (rot == 0) { 103 | tft.setTextScale(0); 104 | tft.setCursor(CENTER, CENTER); 105 | tft.print("Button Demo"); 106 | delay(1000); 107 | tft.clearScreen(); 108 | } 109 | tft.drawRect(0, 0, 50, 50, YELLOW);//draw a rect as text container 110 | tft.setCursor(25, 25, REL_XY);//now draw text in the middle of the rect 111 | tft.setTextScale(1); 112 | tft.print("BUTTON");//notice that text is exact in the middle of the rect 113 | } 114 | 115 | void runTest(uint8_t test, uint8_t rot) 116 | { 117 | switch (test) { 118 | case 0: 119 | centerText1(rot); 120 | break; 121 | case 1: 122 | centerText2(rot); 123 | break; 124 | case 2: 125 | centerText3(rot); 126 | break; 127 | case 3: 128 | buttonDemo(rot); 129 | break; 130 | } 131 | } 132 | 133 | uint8_t rot = 0; 134 | uint8_t test = 0; 135 | 136 | 137 | 138 | void loop(void) { 139 | if (rot > 3) { 140 | rot = 0; 141 | test++; 142 | } 143 | if (test > 3) test = 0; 144 | runTest(test, rot); 145 | delay(500); 146 | rot++; 147 | } 148 | 149 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | SSD_13XX KEYWORD1 2 | begin KEYWORD2 3 | setArea KEYWORD2 4 | setPartialArea KEYWORD2 5 | changeMode KEYWORD2 6 | getMode KEYWORD2 7 | height KEYWORD2 8 | width KEYWORD2 9 | cgHeight KEYWORD2 10 | cgWidth KEYWORD2 11 | setRotation KEYWORD2 12 | getRotation KEYWORD2 13 | setBackground KEYWORD2 14 | setForeground KEYWORD2 15 | getBackground KEYWORD2 16 | getForeground KEYWORD2 17 | setBrightness KEYWORD2 18 | setColorDepth KEYWORD2 19 | setColorOrder KEYWORD2 20 | fillScreen KEYWORD2 21 | clearScreen KEYWORD2 22 | drawPixel KEYWORD2 23 | copyArea KEYWORD2 24 | dimArea KEYWORD2 25 | moveArea KEYWORD2 26 | drawFastVLine KEYWORD2 27 | drawFastHLine KEYWORD2 28 | drawLine KEYWORD2 29 | drawRect KEYWORD2 30 | fillRect KEYWORD2 31 | drawTriangle KEYWORD2 32 | fillTriangle KEYWORD2 33 | drawCircle KEYWORD2 34 | fillCircle KEYWORD2 35 | drawRoundRect KEYWORD2 36 | fillRoundRect KEYWORD2 37 | drawQuad KEYWORD2 38 | fillQuad KEYWORD2 39 | drawMesh KEYWORD2 40 | drawPolygon KEYWORD2 41 | drawArc KEYWORD2 42 | drawEllipse KEYWORD2 43 | ringMeter KEYWORD2 44 | drawLineAngle KEYWORD2 45 | drawBitmap KEYWORD2 46 | pushColor KEYWORD2 47 | startPushData KEYWORD2 48 | pushData KEYWORD2 49 | endPushData KEYWORD2 50 | drawImage KEYWORD2 51 | drawIcon KEYWORD2 52 | setTextColor KEYWORD2 53 | setTextScale KEYWORD2 54 | setTextWrap KEYWORD2 55 | setCharSpacing KEYWORD2 56 | setFontInterline KEYWORD2 57 | setInternalFont KEYWORD2 58 | setFont KEYWORD2 59 | setCursor KEYWORD2 60 | getCursor KEYWORD2 61 | getErrorCode KEYWORD2 62 | display KEYWORD2 63 | defineScrollArea KEYWORD2 64 | scroll KEYWORD2 65 | gradient KEYWORD2 66 | colorInterpolation KEYWORD2 67 | Color565 KEYWORD2 68 | Color24To565 KEYWORD2 69 | htmlTo565 KEYWORD2 70 | Color565ToRGB KEYWORD2 71 | 72 | NORMAL LITERAL1 73 | PWRSAVE LITERAL1 74 | INVERT LITERAL1 75 | DISP_DIM LITERAL1 76 | INVERT LITERAL1 77 | DISP_ON LITERAL1 78 | DISP_OFF LITERAL1 79 | ALL_ON LITERAL1 80 | ALL_OFF LITERAL1 81 | PROTECT LITERAL1 82 | NONE LITERAL1 83 | TRANSPARENT LITERAL1 84 | REPLACE LITERAL1 85 | NORM LITERAL1 86 | SCREEN LITERAL1 87 | REL_X LITERAL1 88 | REL_Y LITERAL1 89 | REL_XY LITERAL1 90 | BOTH LITERAL1 91 | BLACK LITERAL1 92 | WHITE LITERAL1 93 | BLUE LITERAL1 94 | NAVY LITERAL1 95 | DARKGREEN LITERAL1 96 | DARKCYAN LITERAL1 97 | MAROON LITERAL1 98 | PURPLE LITERAL1 99 | ORANGE LITERAL1 100 | PINK LITERAL1 101 | OLIVE LITERAL1 102 | GREENYELLOW LITERAL1 103 | RED LITERAL1 104 | GREEN LITERAL1 105 | CYAN LITERAL1 106 | MAGENTA LITERAL1 107 | YELLOW LITERAL1 108 | BRIGHT_RED LITERAL1 109 | LIGHT_GREY LITERAL1 110 | DARK_GREY LITERAL1 111 | 112 | -------------------------------------------------------------------------------- /library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SSD_13XX", 3 | "frameworks": "Arduino", 4 | "platforms": 5 | [ 6 | "Teensy", 7 | "atmelavr", 8 | "espressif", 9 | "arm" 10 | ], 11 | "keywords": "display", 12 | "description": "A very fast driver for SSD_13XX OLED displays that works with many MCU", 13 | "version": "1.0", 14 | "exclude": [ 15 | "doc", 16 | "*.pdf" 17 | ], 18 | "authors": 19 | { 20 | "name": "sumotoy", 21 | "email": "sumotoy@gmail.com", 22 | "url": "http://sumotoy.com", 23 | "maintainer": true 24 | }, 25 | "repository": 26 | { 27 | "type": "git", 28 | "url": "https://github.com/sumotoy/SSD_13XX" 29 | }, 30 | "dependencies": 31 | { 32 | "name": "SPI", 33 | "frameworks": "arduino" 34 | }, 35 | "examples": [ 36 | "examples/*/*.ino", 37 | "examples/*/*/*.ino" 38 | ] 39 | } 40 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=SSD_13XX 2 | version=1.0 3 | author=Max MC Costa 4 | maintainer=sumotoy 5 | sentence=A fast full featured SPI driver for TFT drived by SSD_13XX, fully SPI Transaction compatible and Fast. 6 | paragraph=This library works with Teensy 3.2,Teensy 3.1,Teensy 3.0,Teensy 3.4,Teensy 3.5,Teensy LC,8Bit Arduino's(UNO,2009,etc.), DUE, ESP8266 7 | category=Display 8 | url=https://github.com/sumotoy/SSD_13XX 9 | architectures=* 10 | --------------------------------------------------------------------------------