├── ACROBOTIC_SSD1306.cpp ├── ACROBOTIC_SSD1306.h ├── LICENSE.txt ├── README.md ├── examples ├── ControlBrightness │ └── ControlBrightness.ino ├── DrawLogo │ └── DrawLogo.ino ├── HelloOLED │ └── HelloOLED.ino └── HelloString │ └── HelloString.ino ├── fonts ├── font5x7.h └── font8x8.h ├── keywords.txt └── library.properties /ACROBOTIC_SSD1306.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 06/01/2016 3 | Author: Makerbro 4 | Platforms: ESP8266 5 | Language: C++ 6 | File: ACROBOTIC_SSD1306.cpp 7 | ------------------------------------------------------------------------ 8 | Description: 9 | SSD1306 OLED Driver Library. 10 | ------------------------------------------------------------------------ 11 | Please consider buying products from ACROBOTIC to help fund future 12 | Open-Source projects like this! We'll always put our best effort in every 13 | project, and release all our design files and code for you to use. 14 | https://acrobotic.com/ 15 | ------------------------------------------------------------------------ 16 | License: 17 | Released under the MIT license. Please check LICENSE.txt for more 18 | information. All text above must be included in any redistribution. 19 | */ 20 | 21 | #include "ACROBOTIC_SSD1306.h" 22 | 23 | void ACROBOTIC_SSD1306::init(TwoWire& wire) 24 | { 25 | m_wire = &wire; 26 | displayOff(); //display off 27 | sendCommand(0xA6); //Set Normal Display (default) 28 | displayOff(); //display off 29 | sendCommand(0xD5); //SETDISPLAYCLOCKDIV 30 | sendCommand(0x80); // the suggested ratio 0x80 31 | sendCommand(0xA8); //SSD1306_SETMULTIPLEX 32 | sendCommand(SSD1306_Max_Y); 33 | sendCommand(0xD3); //SETDISPLAYOFFSET 34 | sendCommand(0x0); //no offset 35 | sendCommand(0x40|0x0); //SETSTARTLINE 36 | sendCommand(0x8D); //CHARGEPUMP 37 | sendCommand(0x14); 38 | sendCommand(0x20); //MEMORYMODE 39 | sendCommand(0x00); //0x0 act like ks0108 40 | sendCommand(0xA1); //SEGREMAP Mirror screen horizontally (A0) 41 | sendCommand(0xC8); //COMSCANDEC Rotate screen vertically (C0) 42 | sendCommand(0xDA); //0xDA 43 | sendCommand(0x12); //COMSCANDEC 44 | sendCommand(0x81); //SETCONTRAST 45 | sendCommand(0xCF); // 46 | sendCommand(0xd9); //SETPRECHARGE 47 | sendCommand(0xF1); 48 | sendCommand(0xDB); //SETVCOMDETECT 49 | sendCommand(0x40); 50 | sendCommand(0xA4); //DISPLAYALLON_RESUME 51 | sendCommand(0xA6); //NORMALDISPLAY 52 | clearDisplay(); 53 | sendCommand(0x2E); //Stop scroll 54 | sendCommand(0x20); //Set Memory Addressing Mode 55 | sendCommand(0x00); //Set Memory Addressing Mode ab Horizontal addressing mode 56 | setFont(font8x8); 57 | } 58 | 59 | void ACROBOTIC_SSD1306::displayOn() 60 | { 61 | sendCommand(0xAF); 62 | } 63 | 64 | void ACROBOTIC_SSD1306::displayOff() 65 | { 66 | sendCommand(0xAE); 67 | } 68 | 69 | void ACROBOTIC_SSD1306::setFont(const uint8_t* font, bool inverse) 70 | { 71 | m_font = font; 72 | m_inverse=inverse; 73 | m_font_width = pgm_read_byte(&m_font[0]); 74 | } 75 | 76 | void ACROBOTIC_SSD1306::sendCommand(unsigned char command) 77 | { 78 | m_wire->beginTransmission(SSD1306_Address); // begin I2C communication 79 | m_wire->write(SSD1306_Command_Mode); // Set OLED Command mode 80 | m_wire->write(command); 81 | m_wire->endTransmission(); // End I2C communication 82 | } 83 | 84 | void ACROBOTIC_SSD1306::setBrightness(unsigned char Brightness) 85 | { 86 | sendCommand(SSD1306_Set_Brightness_Cmd); 87 | sendCommand(Brightness); 88 | } 89 | 90 | void ACROBOTIC_SSD1306::setHorizontalMode() 91 | { 92 | addressingMode = HORIZONTAL_MODE; 93 | sendCommand(0x20); //set addressing mode 94 | sendCommand(0x00); //set horizontal addressing mode 95 | } 96 | 97 | void ACROBOTIC_SSD1306::setPageMode() 98 | { 99 | addressingMode = PAGE_MODE; 100 | sendCommand(0x20); //set addressing mode 101 | sendCommand(0x02); //set page addressing mode 102 | } 103 | 104 | void ACROBOTIC_SSD1306::setTextXY(unsigned char row, unsigned char col) 105 | { 106 | sendCommand(0xB0 + row); //set page address 107 | sendCommand(0x00 + (m_font_width*col & 0x0F)); //set column lower addr 108 | sendCommand(0x10 + ((m_font_width*col>>4)&0x0F)); //set column higher addr 109 | } 110 | 111 | void ACROBOTIC_SSD1306::clearDisplay() 112 | { 113 | unsigned char i,j; 114 | sendCommand(SSD1306_Display_Off_Cmd); //display off 115 | for(j=0;j<8;j++) 116 | { 117 | setTextXY(j,0); 118 | { 119 | for(i=0;i<16;i++) //clear all columns 120 | { 121 | putChar(' '); 122 | } 123 | } 124 | } 125 | sendCommand(SSD1306_Display_On_Cmd); //display on 126 | setTextXY(0,0); 127 | } 128 | 129 | void ACROBOTIC_SSD1306::sendData(unsigned char Data) 130 | { 131 | m_wire->beginTransmission(SSD1306_Address); // begin I2C transmission 132 | m_wire->write(SSD1306_Data_Mode); // data mode 133 | m_wire->write(m_inverse?~Data:Data); 134 | m_wire->endTransmission(); // stop I2C transmission 135 | } 136 | 137 | bool ACROBOTIC_SSD1306::putChar(unsigned char ch) 138 | { 139 | if (!m_font) return 0; 140 | //Ignore non-printable ASCII characters. This can be modified for 141 | //multilingual font. 142 | if(ch < 32 || ch > 127) 143 | { 144 | ch = ' '; 145 | } 146 | for(unsigned char i=0;i 0) 191 | { 192 | char_buffer[i++] = long_num % 10; 193 | long_num /= 10; 194 | } 195 | 196 | f=f+i; 197 | for(; i > 0; i--) 198 | { 199 | putChar('0'+ char_buffer[i - 1]); 200 | } 201 | return f; 202 | 203 | } 204 | 205 | unsigned char ACROBOTIC_SSD1306::putFloat(float floatNumber,unsigned char decimal) 206 | { 207 | unsigned int temp=0; 208 | float decy=0.0; 209 | float rounding = 0.5; 210 | unsigned char f=0; 211 | if(floatNumber<0.0) 212 | { 213 | putString("-"); 214 | floatNumber = -floatNumber; 215 | f +=1; 216 | } 217 | for (unsigned char i=0; i0) 226 | { 227 | putChar('.'); 228 | f +=1; 229 | } 230 | decy = floatNumber-temp;//decimal part, 231 | for(unsigned char i=0;i0) 263 | { 264 | putChar('.'); 265 | f +=1; 266 | } 267 | decy = floatNumber-temp;//decimal part, 268 | for(unsigned char i=0;i= 100 25 | #include "Arduino.h" 26 | #else 27 | #include "WProgram.h" 28 | #endif 29 | 30 | #ifdef __AVR__ 31 | #include 32 | #define OLEDFONT(name) static const uint8_t __attribute__ ((progmem)) name[] 33 | #elif defined(ESP8266) 34 | #include 35 | #define OLEDFONT(name) static const uint8_t name[] 36 | #else 37 | #define pgm_read_byte(addr) (*(const unsigned char *)(addr)) 38 | #define OLEDFONT(name) static const uint8_t name[] 39 | #endif 40 | 41 | #include "Wire.h" 42 | #include "fonts/font8x8.h" 43 | #include "fonts/font5x7.h" 44 | 45 | // Default screen size is 128x64. Using a #define in your sketch before 46 | // the #include statement can change the default size. 47 | 48 | #if !defined SSD1306_128_64 && !defined SSD1306_128_32 49 | #define SSD1306_128_64 50 | #endif 51 | 52 | #if defined SSD1306_128_64 53 | #define SSD1306_Max_X 127 54 | #define SSD1306_Max_Y 63 55 | #endif 56 | #if defined SSD1306_128_32 57 | #define SSD1306_Max_X 127 58 | #define SSD1306_Max_Y 31 59 | #endif 60 | 61 | #define PAGE_MODE 01 62 | #define HORIZONTAL_MODE 02 63 | 64 | #define SSD1306_Address 0x3C 65 | #define SSD1306_Command_Mode 0x80 66 | #define SSD1306_Data_Mode 0x40 67 | #define SSD1306_Display_Off_Cmd 0xAE 68 | #define SSD1306_Display_On_Cmd 0xAF 69 | #define SSD1306_Normal_Display_Cmd 0xA6 70 | #define SSD1306_Inverse_Display_Cmd 0xA7 71 | #define SSD1306_Activate_Scroll_Cmd 0x2F 72 | #define SSD1306_Dectivate_Scroll_Cmd 0x2E 73 | #define SSD1306_Set_Brightness_Cmd 0x81 74 | 75 | #define Scroll_Left 0x00 76 | #define Scroll_Right 0x01 77 | 78 | #define Scroll_2Frames 0x7 79 | #define Scroll_3Frames 0x4 80 | #define Scroll_4Frames 0x5 81 | #define Scroll_5Frames 0x0 82 | #define Scroll_25Frames 0x6 83 | #define Scroll_64Frames 0x1 84 | #define Scroll_128Frames 0x2 85 | #define Scroll_256Frames 0x3 86 | 87 | class ACROBOTIC_SSD1306 { 88 | public: 89 | char addressingMode; 90 | void init(TwoWire& wire=Wire); 91 | 92 | void setNormalDisplay(); 93 | void setInverseDisplay(); 94 | 95 | void sendCommand(unsigned char command); 96 | void sendData(unsigned char Data); 97 | 98 | void setPageMode(); 99 | void setHorizontalMode(); 100 | 101 | void setTextXY(unsigned char Row, unsigned char Column); 102 | void clearDisplay(); 103 | void setBrightness(unsigned char Brightness); 104 | bool putChar(unsigned char c); 105 | void putString(const char *string); 106 | void putString(String string); 107 | unsigned char putNumber(long n); 108 | unsigned char putFloat(float floatNumber,unsigned char decimal); 109 | unsigned char putFloat(float floatNumber); 110 | void drawBitmap(unsigned char *bitmaparray,int bytes); 111 | 112 | void setHorizontalScrollProperties( 113 | bool direction, 114 | unsigned char startPage, 115 | unsigned char endPage, 116 | unsigned char scrollSpeed); 117 | void activateScroll(); 118 | void deactivateScroll(); 119 | 120 | void displayOn(); 121 | void displayOff(); 122 | 123 | void setFont(const uint8_t* font, bool inverse=false); 124 | 125 | private: 126 | const uint8_t* m_font; // Current font. 127 | uint8_t m_font_offset = 2; // Font bytes for meta data. 128 | uint8_t m_font_width; // Font witdth. 129 | uint8_t m_col; // Cursor column. 130 | uint8_t m_row; // Cursor row (RAM). 131 | bool m_inverse=false; // Inverse text. 132 | TwoWire* m_wire; 133 | }; 134 | 135 | extern ACROBOTIC_SSD1306 oled; // ACROBOTIC_SSD1306 object 136 | 137 | #endif 138 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 ACROBOTIC Idustries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ai_Ardulib_SSD1306 2 | 3 | Example code for using the ESP8266 Development Board and an OLED display for 4 | visualizing different things on its 128×64 pixel screen. 5 | 6 | ## Description 7 | 8 | For more details, check out the tutorial page at: 9 | 10 | * http://learn.acrobotic.com/tutorials/post/esp8266-oled-display-using-i2c 11 | 12 | If you like my work, you can help me dedicate more time to building projects, 13 | writing code, and making videos about them: 14 | 15 | * https://www.patreon.com/acrobotic 16 | * https://www.paypal.me/acrobotic 17 | 18 | You can also purchase products from my little online shops to help fund future 19 | Open-Source projects like these! I'll always put my best effort in every project, 20 | and release all my design files and code for you to use. 21 | 22 | * https://acrobotic.com/ 23 | * https://amazon.com/acrobotic 24 | 25 | ## Installation 26 | 27 | Please follow the instructions outlined in the tutorial linked above. The steps 28 | describe how to install the library needed for the programs to run properly. 29 | 30 | ## License 31 | 32 | Released under the MIT license. Please check LICENSE.txt for more information. 33 | All text above must be included in any redistribution. 34 | -------------------------------------------------------------------------------- /examples/ControlBrightness/ControlBrightness.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 06/01/2016 3 | Author: Makerbro 4 | Platforms: ESP8266 5 | Language: C++ 6 | File: ControlBrightness.ino 7 | ------------------------------------------------------------------------ 8 | Description: 9 | Brightness control example for OLED display. 10 | ------------------------------------------------------------------------ 11 | Please consider buying products from ACROBOTIC to help fund future 12 | Open-Source projects like this! We'll always put our best effort in every 13 | project, and release all our design files and code for you to use. 14 | https://acrobotic.com/ 15 | ------------------------------------------------------------------------ 16 | License: 17 | Released under the MIT license. Please check LICENSE.txt for more 18 | information. All text above must be included in any redistribution. 19 | */ 20 | #include 21 | #include 22 | 23 | static unsigned char const ACROBOT[] PROGMEM ={ 24 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xC8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 44 | 0xFE, 0xFF, 0xFE, 0xF8, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0x03, 0x03, 0x41, 0xE1, 0xE1, 0x41, 0x03, 0x03, 0x07, 0x1F, 52 | 0xFF, 0xC1, 0x81, 0x00, 0x00, 0x00, 0x00, 0x81, 0xC3, 0xFF, 0xFF, 0xFC, 0xFC, 0x78, 0x00, 0x00, 53 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x0C, 0x1E, 0x1F, 0x3F, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xF0, 0xF0, 0x10, 0x18, 0x18, 0x1C, 0x1F, 60 | 0x0F, 0x0F, 0x0F, 0xCF, 0x07, 0x07, 0x87, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xE0, 0x00, 0x00, 61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x1F, 0x1F, 0x8F, 0x8F, 0x8E, 0xCE, 0xCE, 0xCE, 0xC7, 68 | 0xC6, 0x46, 0x47, 0xE7, 0xE7, 0xE3, 0xE3, 0xE3, 0xE3, 0xC3, 0x03, 0x01, 0x01, 0xC0, 0xC0, 0x80, 69 | 0x80, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x78, 0xFC, 0xFF, 0xFF, 0xFE, 0xFC, 75 | 0x7E, 0x7E, 0x3E, 0x3E, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF1, 0xE0, 76 | 0x40, 0x40, 0x40, 0x60, 0x71, 0x7F, 0x7F, 0x7F, 0x7F, 0x3F, 0x3C, 0x00, 0x00, 0x03, 0x07, 0x0F, 77 | 0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x3E, 0x1C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE0, 0x60, 0x60, 0x70, 0x7C, 0x7C, 0x7C, 84 | 0x7C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x3E, 0x3E, 0x3C, 0x38, 0x38, 0x18, 0x18, 0x00, 0x00, 0x00, 85 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 88 | }; 89 | 90 | void setup() 91 | { 92 | Wire.begin(); 93 | oled.init(); // Initialze SSD1306 OLED display 94 | oled.clearDisplay(); // Clear screen 95 | oled.drawBitmap(ACROBOT, 1024); // 1024 pixels for logo 96 | oled.setTextXY(0,1); // Set cursor position 97 | oled.putString(" ACROBOTIC "); 98 | } 99 | 100 | unsigned char brightness = 0; 101 | 102 | void loop() 103 | { 104 | oled.setBrightness((unsigned char)brightness); 105 | oled.setPageMode(); 106 | oled.setTextXY(7,13); 107 | oled.putNumber(brightness); 108 | delay(500); 109 | if(brightness == 255) 110 | { 111 | oled.setTextXY(7,13); // Display the brighness value starting from 7th Row, 13th Column 112 | oled.putString(" "); // Clear 13,14 and 15th Columns. Numbers left aligned. 113 | brightness = 0; // Reset brighness to 0. 114 | } else 115 | brightness+=51; 116 | } 117 | -------------------------------------------------------------------------------- /examples/DrawLogo/DrawLogo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 06/01/2016 3 | Author: Makerbro 4 | Platforms: ESP8266 5 | Language: C++ 6 | File: DrawLogo.ino 7 | ------------------------------------------------------------------------ 8 | Description: 9 | Drawing an image in the OLED display. The image date was generated using a 10 | bitmap generator. 11 | ------------------------------------------------------------------------ 12 | Please consider buying products from ACROBOTIC to help fund future 13 | Open-Source projects like this! We'll always put our best effort in every 14 | project, and release all our design files and code for you to use. 15 | https://acrobotic.com/ 16 | ------------------------------------------------------------------------ 17 | License: 18 | Released under the MIT license. Please check LICENSE.txt for more 19 | information. All text above must be included in any redistribution. 20 | */ 21 | #include 22 | #include 23 | 24 | static unsigned char const ACROBOT[] PROGMEM ={ 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0xC8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 45 | 0xFE, 0xFF, 0xFE, 0xF8, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 50 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 51 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 | 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x0F, 0x03, 0x03, 0x41, 0xE1, 0xE1, 0x41, 0x03, 0x03, 0x07, 0x1F, 53 | 0xFF, 0xC1, 0x81, 0x00, 0x00, 0x00, 0x00, 0x81, 0xC3, 0xFF, 0xFF, 0xFC, 0xFC, 0x78, 0x00, 0x00, 54 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x0C, 0x1E, 0x1F, 0x3F, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xF0, 0xF0, 0x10, 0x18, 0x18, 0x1C, 0x1F, 61 | 0x0F, 0x0F, 0x0F, 0xCF, 0x07, 0x07, 0x87, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xE0, 0x00, 0x00, 62 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 63 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 64 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 65 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 68 | 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x1F, 0x1F, 0x8F, 0x8F, 0x8E, 0xCE, 0xCE, 0xCE, 0xC7, 69 | 0xC6, 0x46, 0x47, 0xE7, 0xE7, 0xE3, 0xE3, 0xE3, 0xE3, 0xC3, 0x03, 0x01, 0x01, 0xC0, 0xC0, 0x80, 70 | 0x80, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 73 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 74 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x78, 0xFC, 0xFF, 0xFF, 0xFE, 0xFC, 76 | 0x7E, 0x7E, 0x3E, 0x3E, 0x1F, 0x1F, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF1, 0xE0, 77 | 0x40, 0x40, 0x40, 0x60, 0x71, 0x7F, 0x7F, 0x7F, 0x7F, 0x3F, 0x3C, 0x00, 0x00, 0x03, 0x07, 0x0F, 78 | 0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x3E, 0x1C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 83 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 84 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xE0, 0x60, 0x60, 0x70, 0x7C, 0x7C, 0x7C, 85 | 0x7C, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x3E, 0x3E, 0x3C, 0x38, 0x38, 0x18, 0x18, 0x00, 0x00, 0x00, 86 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 87 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 88 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 89 | }; 90 | 91 | void setup() 92 | { 93 | Wire.begin(); 94 | oled.init(); // Initialze SSD1306 OLED display 95 | oled.clearDisplay(); // Clear screen 96 | oled.drawBitmap(ACROBOT, 1024); // 1024 pixels for logo 97 | } 98 | 99 | void loop() 100 | { 101 | } 102 | -------------------------------------------------------------------------------- /examples/HelloOLED/HelloOLED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 06/01/2016 3 | Author: Makerbro 4 | Platforms: ESP8266 5 | Language: C++ 6 | File: HelloOLED.ino 7 | ------------------------------------------------------------------------ 8 | Description: 9 | Demo for OLED display showcasing writing text to the screen. 10 | ------------------------------------------------------------------------ 11 | Please consider buying products from ACROBOTIC to help fund future 12 | Open-Source projects like this! We'll always put our best effort in every 13 | project, and release all our design files and code for you to use. 14 | https://acrobotic.com/ 15 | ------------------------------------------------------------------------ 16 | License: 17 | Released under the MIT license. Please check LICENSE.txt for more 18 | information. All text above must be included in any redistribution. 19 | */ 20 | #include 21 | #include "ACROBOTIC_SSD1306.h" 22 | 23 | void setup() 24 | { 25 | Wire.begin(); 26 | oled.init(); // Initialze SSD1306 OLED display 27 | oled.clearDisplay(); // Clear screen 28 | oled.setTextXY(0,0); // Set cursor position, start of line 0 29 | oled.putString("ACROBOTIC"); 30 | oled.setTextXY(1,0); // Set cursor position, start of line 1 31 | oled.putString("industries"); 32 | oled.setTextXY(2,0); // Set cursor position, start of line 2 33 | oled.putString("Pasadena,"); 34 | oled.setTextXY(2,10); // Set cursor position, line 2 10th character 35 | oled.putString("CA"); 36 | } 37 | 38 | void loop() 39 | { 40 | } 41 | -------------------------------------------------------------------------------- /examples/HelloString/HelloString.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 07/29/2016 3 | Author: Makerbro 4 | Platforms: ESP8266 5 | Language: C++ 6 | File: HelloString.ino 7 | ------------------------------------------------------------------------ 8 | Description: 9 | Demo for OLED displays showcasing writing string types. 10 | ------------------------------------------------------------------------ 11 | Please consider buying products from ACROBOTIC to help fund future 12 | Open-Source projects like this! We'll always put our best effort in every 13 | project, and release all our design files and code for you to use. 14 | https://acrobotic.com/ 15 | ------------------------------------------------------------------------ 16 | License: 17 | Released under the MIT license. Please check LICENSE.txt for more 18 | information. All text above must be included in any redistribution. 19 | */ 20 | #include 21 | #include 22 | #include 23 | 24 | void setup() 25 | { 26 | Wire.begin(); 27 | oled.init(); // Initialze SSD1306 OLED display 28 | oled.setFont(font5x7); // Set font type (default 8x8) 29 | oled.clearDisplay(); // Clear screen 30 | oled.setTextXY(0,0); // Set cursor position, start of line 0 31 | String ipAddress = IPAddress2String(Ethernet.localIP()); 32 | oled.putString(ipAddress); 33 | } 34 | 35 | void loop() 36 | { 37 | } 38 | 39 | String IPAddress2String(IPAddress address) 40 | { 41 | return String(address[0]) + "." + 42 | String(address[1]) + "." + 43 | String(address[2]) + "." + 44 | String(address[3]); 45 | } 46 | -------------------------------------------------------------------------------- /fonts/font5x7.h: -------------------------------------------------------------------------------- 1 | #ifndef FONT5x7_H 2 | #define FONT5x7_H 3 | 4 | // 5x7 Font ASCII 32 - 127 Implemented 5 | // Users can modify this to support more characters (glyphs) 6 | 7 | OLEDFONT(font5x7) PROGMEM = 8 | { 9 | 0x05, // width 10 | 0x07, // height 11 | 0x00, 0x00, 0x00, 0x00, 0x00, // SPACE 12 | 0x00, 0x00, 0x5F, 0x00, 0x00, // ! 13 | 0x00, 0x03, 0x00, 0x03, 0x00, // " 14 | 0x14, 0x3E, 0x14, 0x3E, 0x14, // # 15 | 0x24, 0x2A, 0x7F, 0x2A, 0x12, // $ 16 | 0x43, 0x33, 0x08, 0x66, 0x61, // % 17 | 0x36, 0x49, 0x55, 0x22, 0x50, // & 18 | 0x00, 0x05, 0x03, 0x00, 0x00, // ' 19 | 0x00, 0x1C, 0x22, 0x41, 0x00, // ( 20 | 0x00, 0x41, 0x22, 0x1C, 0x00, // ) 21 | 0x14, 0x08, 0x3E, 0x08, 0x14, // * 22 | 0x08, 0x08, 0x3E, 0x08, 0x08, // + 23 | 0x00, 0x50, 0x30, 0x00, 0x00, // , 24 | 0x08, 0x08, 0x08, 0x08, 0x08, // - 25 | 0x00, 0x60, 0x60, 0x00, 0x00, // . 26 | 0x20, 0x10, 0x08, 0x04, 0x02, // / 27 | 28 | 0x3E, 0x51, 0x49, 0x45, 0x3E, // 0 29 | 0x00, 0x04, 0x02, 0x7F, 0x00, // 1 30 | 0x42, 0x61, 0x51, 0x49, 0x46, // 2 31 | 0x22, 0x41, 0x49, 0x49, 0x36, // 3 32 | 0x18, 0x14, 0x12, 0x7F, 0x10, // 4 33 | 0x27, 0x45, 0x45, 0x45, 0x39, // 5 34 | 0x3E, 0x49, 0x49, 0x49, 0x32, // 6 35 | 0x01, 0x01, 0x71, 0x09, 0x07, // 7 36 | 0x36, 0x49, 0x49, 0x49, 0x36, // 8 37 | 0x26, 0x49, 0x49, 0x49, 0x3E, // 9 38 | 0x00, 0x36, 0x36, 0x00, 0x00, // : 39 | 0x00, 0x56, 0x36, 0x00, 0x00, // ; 40 | 0x08, 0x14, 0x22, 0x41, 0x00, // < 41 | 0x14, 0x14, 0x14, 0x14, 0x14, // = 42 | 0x00, 0x41, 0x22, 0x14, 0x08, // > 43 | 0x02, 0x01, 0x51, 0x09, 0x06, // ? 44 | 45 | 0x3E, 0x41, 0x59, 0x55, 0x5E, // @ 46 | 0x7E, 0x09, 0x09, 0x09, 0x7E, // A 47 | 0x7F, 0x49, 0x49, 0x49, 0x36, // B 48 | 0x3E, 0x41, 0x41, 0x41, 0x22, // C 49 | 0x7F, 0x41, 0x41, 0x41, 0x3E, // D 50 | 0x7F, 0x49, 0x49, 0x49, 0x41, // E 51 | 0x7F, 0x09, 0x09, 0x09, 0x01, // F 52 | 0x3E, 0x41, 0x41, 0x49, 0x3A, // G 53 | 0x7F, 0x08, 0x08, 0x08, 0x7F, // H 54 | 0x00, 0x41, 0x7F, 0x41, 0x00, // I 55 | 0x30, 0x40, 0x40, 0x40, 0x3F, // J 56 | 0x7F, 0x08, 0x14, 0x22, 0x41, // K 57 | 0x7F, 0x40, 0x40, 0x40, 0x40, // L 58 | 0x7F, 0x02, 0x0C, 0x02, 0x7F, // M 59 | 0x7F, 0x02, 0x04, 0x08, 0x7F, // N 60 | 0x3E, 0x41, 0x41, 0x41, 0x3E, // O 61 | 62 | 0x7F, 0x09, 0x09, 0x09, 0x06, // P 63 | 0x1E, 0x21, 0x21, 0x21, 0x5E, // Q 64 | 0x7F, 0x09, 0x09, 0x09, 0x76, // R 65 | 0x26, 0x49, 0x49, 0x49, 0x32, // S 66 | 0x01, 0x01, 0x7F, 0x01, 0x01, // T 67 | 0x3F, 0x40, 0x40, 0x40, 0x3F, // U 68 | 0x1F, 0x20, 0x40, 0x20, 0x1F, // V 69 | 0x7F, 0x20, 0x10, 0x20, 0x7F, // W 70 | 0x41, 0x22, 0x1C, 0x22, 0x41, // X 71 | 0x07, 0x08, 0x70, 0x08, 0x07, // Y 72 | 0x61, 0x51, 0x49, 0x45, 0x43, // Z 73 | 0x00, 0x7F, 0x41, 0x00, 0x00, // [ 74 | 0x02, 0x04, 0x08, 0x10, 0x20, // backslash 75 | 0x00, 0x00, 0x41, 0x7F, 0x00, // ] 76 | 0x04, 0x02, 0x01, 0x02, 0x04, // ^ 77 | 0x40, 0x40, 0x40, 0x40, 0x40, // _ 78 | 79 | 0x00, 0x01, 0x02, 0x04, 0x00, // ` 80 | 0x20, 0x54, 0x54, 0x54, 0x78, // a 81 | 0x7F, 0x44, 0x44, 0x44, 0x38, // b 82 | 0x38, 0x44, 0x44, 0x44, 0x44, // c 83 | 0x38, 0x44, 0x44, 0x44, 0x7F, // d 84 | 0x38, 0x54, 0x54, 0x54, 0x18, // e 85 | 0x04, 0x04, 0x7E, 0x05, 0x05, // f 86 | 0x08, 0x54, 0x54, 0x54, 0x3C, // g 87 | 0x7F, 0x08, 0x04, 0x04, 0x78, // h 88 | 0x00, 0x44, 0x7D, 0x40, 0x00, // i 89 | 0x20, 0x40, 0x44, 0x3D, 0x00, // j 90 | 0x7F, 0x10, 0x28, 0x44, 0x00, // k 91 | 0x00, 0x41, 0x7F, 0x40, 0x00, // l 92 | 0x7C, 0x04, 0x78, 0x04, 0x78, // m 93 | 0x7C, 0x08, 0x04, 0x04, 0x78, // n 94 | 0x38, 0x44, 0x44, 0x44, 0x38, // o 95 | 96 | 0x7C, 0x14, 0x14, 0x14, 0x08, // p 97 | 0x08, 0x14, 0x14, 0x14, 0x7C, // q 98 | 0x00, 0x7C, 0x08, 0x04, 0x04, // r 99 | 0x48, 0x54, 0x54, 0x54, 0x20, // s 100 | 0x04, 0x04, 0x3F, 0x44, 0x44, // t 101 | 0x3C, 0x40, 0x40, 0x20, 0x7C, // u 102 | 0x1C, 0x20, 0x40, 0x20, 0x1C, // v 103 | 0x3C, 0x40, 0x30, 0x40, 0x3C, // w 104 | 0x44, 0x28, 0x10, 0x28, 0x44, // x 105 | 0x0C, 0x50, 0x50, 0x50, 0x3C, // y 106 | 0x44, 0x64, 0x54, 0x4C, 0x44, // z 107 | 0x00, 0x08, 0x36, 0x41, 0x41, // { 108 | 0x00, 0x00, 0x7F, 0x00, 0x00, // | 109 | 0x41, 0x41, 0x36, 0x08, 0x00, // } 110 | 0x02, 0x01, 0x02, 0x04, 0x02 // ~ 111 | }; 112 | #endif // font5x7_h 113 | 114 | -------------------------------------------------------------------------------- /fonts/font8x8.h: -------------------------------------------------------------------------------- 1 | #ifndef FONT8x8_H 2 | #define FONT8x8_H 3 | 4 | // 8x8 Font ASCII 32 - 127 Implemented 5 | // Users can modify this to support more characters (glyphs) 6 | 7 | OLEDFONT(font8x8) PROGMEM = 8 | { 9 | 0x08, // width 10 | 0x08, // height 11 | 12 | 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 13 | 0x00,0x00,0x00,0x00,0x5F,0x00,0x00,0x00, // ! 14 | 0x00,0x00,0x00,0x03,0x00,0x03,0x00,0x00, // " 15 | 0x00,0x24,0x7E,0x24,0x24,0x7E,0x24,0x00, // # 16 | 0x00,0x2E,0x2A,0x7F,0x2A,0x3A,0x00,0x00, // $ 17 | 0x00,0x46,0x26,0x10,0x08,0x64,0x62,0x00, // % 18 | 0x00,0x20,0x54,0x4A,0x54,0x20,0x50,0x00, // & 19 | 0x00,0x00,0x00,0x04,0x02,0x00,0x00,0x00, // ' 20 | 0x00,0x00,0x00,0x3C,0x42,0x00,0x00,0x00, // ( 21 | 0x00,0x00,0x00,0x42,0x3C,0x00,0x00,0x00, // ) 22 | 0x00,0x10,0x54,0x38,0x54,0x10,0x00,0x00, // * 23 | 0x00,0x10,0x10,0x7C,0x10,0x10,0x00,0x00, // + 24 | 0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00, // , 25 | 0x00,0x10,0x10,0x10,0x10,0x10,0x00,0x00, // - 26 | 0x00,0x00,0x00,0x60,0x60,0x00,0x00,0x00, // . 27 | 0x00,0x40,0x20,0x10,0x08,0x04,0x00,0x00, // / 28 | 29 | 0x3C,0x62,0x52,0x4A,0x46,0x3C,0x00,0x00, // 0 30 | 0x44,0x42,0x7E,0x40,0x40,0x00,0x00,0x00, // 1 31 | 0x64,0x52,0x52,0x52,0x52,0x4C,0x00,0x00, // 2 32 | 0x24,0x42,0x42,0x4A,0x4A,0x34,0x00,0x00, // 3 33 | 0x30,0x28,0x24,0x7E,0x20,0x20,0x00,0x00, // 4 34 | 0x2E,0x4A,0x4A,0x4A,0x4A,0x32,0x00,0x00, // 5 35 | 0x3C,0x4A,0x4A,0x4A,0x4A,0x30,0x00,0x00, // 6 36 | 0x02,0x02,0x62,0x12,0x0A,0x06,0x00,0x00, // 7 37 | 0x34,0x4A,0x4A,0x4A,0x4A,0x34,0x00,0x00, // 8 38 | 0x0C,0x52,0x52,0x52,0x52,0x3C,0x00,0x00, // 9 39 | 0x00,0x00,0x00,0x48,0x00,0x00,0x00,0x00, // : 40 | 0x00,0x00,0x80,0x64,0x00,0x00,0x00,0x00, // ; 41 | 0x00,0x00,0x10,0x28,0x44,0x00,0x00,0x00, // < 42 | 0x00,0x28,0x28,0x28,0x28,0x28,0x00,0x00, // = 43 | 0x00,0x00,0x44,0x28,0x10,0x00,0x00,0x00, // > 44 | 0x00,0x04,0x02,0x02,0x52,0x0A,0x04,0x00, // ? 45 | 46 | 0x00,0x3C,0x42,0x5A,0x56,0x5A,0x1C,0x00, // @ 47 | 0x7C,0x12,0x12,0x12,0x12,0x7C,0x00,0x00, // A 48 | 0x7E,0x4A,0x4A,0x4A,0x4A,0x34,0x00,0x00, // B 49 | 0x3C,0x42,0x42,0x42,0x42,0x24,0x00,0x00, // C 50 | 0x7E,0x42,0x42,0x42,0x24,0x18,0x00,0x00, // D 51 | 0x7E,0x4A,0x4A,0x4A,0x4A,0x42,0x00,0x00, // E 52 | 0x7E,0x0A,0x0A,0x0A,0x0A,0x02,0x00,0x00, // F 53 | 0x3C,0x42,0x42,0x52,0x52,0x34,0x00,0x00, // G 54 | 0x7E,0x08,0x08,0x08,0x08,0x7E,0x00,0x00, // H 55 | 0x00,0x42,0x42,0x7E,0x42,0x42,0x00,0x00, // I 56 | 0x30,0x40,0x40,0x40,0x40,0x3E,0x00,0x00, // J 57 | 0x7E,0x08,0x08,0x14,0x22,0x40,0x00,0x00, // K 58 | 0x7E,0x40,0x40,0x40,0x40,0x40,0x00,0x00, // L 59 | 0x7E,0x04,0x08,0x08,0x04,0x7E,0x00,0x00, // M 60 | 0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,0x00, // N 61 | 0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,0x00, // O 62 | 63 | 0x7E,0x12,0x12,0x12,0x12,0x0C,0x00,0x00, // P 64 | 0x3C,0x42,0x52,0x62,0x42,0x3C,0x00,0x00, // Q 65 | 0x7E,0x12,0x12,0x12,0x32,0x4C,0x00,0x00, // R 66 | 0x24,0x4A,0x4A,0x4A,0x4A,0x30,0x00,0x00, // S 67 | 0x02,0x02,0x02,0x7E,0x02,0x02,0x02,0x00, // T 68 | 0x3E,0x40,0x40,0x40,0x40,0x3E,0x00,0x00, // U 69 | 0x1E,0x20,0x40,0x40,0x20,0x1E,0x00,0x00, // V 70 | 0x3E,0x40,0x20,0x20,0x40,0x3E,0x00,0x00, // W 71 | 0x42,0x24,0x18,0x18,0x24,0x42,0x00,0x00, // X 72 | 0x02,0x04,0x08,0x70,0x08,0x04,0x02,0x00, // Y 73 | 0x42,0x62,0x52,0x4A,0x46,0x42,0x00,0x00, // Z 74 | 0x00,0x00,0x7E,0x42,0x42,0x00,0x00,0x00, // [ 75 | 0x00,0x04,0x08,0x10,0x20,0x40,0x00,0x00, // 76 | 0x00,0x00,0x42,0x42,0x7E,0x00,0x00,0x00, // ] 77 | 0x00,0x08,0x04,0x7E,0x04,0x08,0x00,0x00, // ^ 78 | 0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00, // _ 79 | 80 | 0x3C,0x42,0x99,0xA5,0xA5,0x81,0x42,0x3C, // ` 81 | 0x00,0x20,0x54,0x54,0x54,0x78,0x00,0x00, // a 82 | 0x00,0x7E,0x48,0x48,0x48,0x30,0x00,0x00, // b 83 | 0x00,0x00,0x38,0x44,0x44,0x44,0x00,0x00, // c 84 | 0x00,0x30,0x48,0x48,0x48,0x7E,0x00,0x00, // d 85 | 0x00,0x38,0x54,0x54,0x54,0x48,0x00,0x00, // e 86 | 0x00,0x00,0x00,0x7C,0x0A,0x02,0x00,0x00, // f 87 | 0x00,0x18,0xA4,0xA4,0xA4,0xA4,0x7C,0x00, // g 88 | 0x00,0x7E,0x08,0x08,0x08,0x70,0x00,0x00, // h 89 | 0x00,0x00,0x00,0x48,0x7A,0x40,0x00,0x00, // i 90 | 0x00,0x00,0x40,0x80,0x80,0x7A,0x00,0x00, // j 91 | 0x00,0x7E,0x18,0x24,0x40,0x00,0x00,0x00, // k 92 | 0x00,0x00,0x00,0x3E,0x40,0x40,0x00,0x00, // l 93 | 0x00,0x7C,0x04,0x78,0x04,0x78,0x00,0x00, // m 94 | 0x00,0x7C,0x04,0x04,0x04,0x78,0x00,0x00, // n 95 | 0x00,0x38,0x44,0x44,0x44,0x38,0x00,0x00, // o 96 | 97 | 0x00,0xFC,0x24,0x24,0x24,0x18,0x00,0x00, // p 98 | 0x00,0x18,0x24,0x24,0x24,0xFC,0x80,0x00, // q 99 | 0x00,0x00,0x78,0x04,0x04,0x04,0x00,0x00, // r 100 | 0x00,0x48,0x54,0x54,0x54,0x20,0x00,0x00, // s 101 | 0x00,0x00,0x04,0x3E,0x44,0x40,0x00,0x00, // t 102 | 0x00,0x3C,0x40,0x40,0x40,0x3C,0x00,0x00, // u 103 | 0x00,0x0C,0x30,0x40,0x30,0x0C,0x00,0x00, // v 104 | 0x00,0x3C,0x40,0x38,0x40,0x3C,0x00,0x00, // w 105 | 0x00,0x44,0x28,0x10,0x28,0x44,0x00,0x00, // x 106 | 0x00,0x1C,0xA0,0xA0,0xA0,0x7C,0x00,0x00, // y 107 | 0x00,0x44,0x64,0x54,0x4C,0x44,0x00,0x00, // z 108 | 0x00,0x08,0x08,0x76,0x42,0x42,0x00,0x00, // { 109 | 0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00, // | 110 | 0x00,0x42,0x42,0x76,0x08,0x08,0x00,0x00, // } 111 | 0x00,0x00,0x04,0x02,0x04,0x02,0x00,0x00, // ~ 112 | }; 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Seeed OLED 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | addressingMode KEYWORD1 10 | ACROBOTIC_SSD1306 KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | 16 | init KEYWORD1 17 | setNormalDisplay KEYWORD1 18 | setInverseDisplay KEYWORD1 19 | sendCommand KEYWORD1 20 | setPageMode KEYWORD1 21 | setHorizontalMode KEYWORD1 22 | setTextXY KEYWORD1 23 | clearDisplay KEYWORD1 24 | setBrightness KEYWORD1 25 | putChar KEYWORD1 26 | putString KEYWORD1 27 | putNumber KEYWORD1 28 | putFloat KEYWORD1 29 | drawBitmap KEYWORD1 30 | chipErase KEYWORD1 31 | setHorizontalScrollProperties KEYWORD1 32 | activateScroll KEYWORD1 33 | deactivateScroll KEYWORD1 34 | 35 | 36 | ####################################### 37 | # Constants (LITERAL1) 38 | ####################################### 39 | 40 | Scroll_Left LITERAL1 41 | Scroll_Right LITERAL1 42 | Scroll_2Frames LITERAL1 43 | Scroll_3Frames LITERAL1 44 | Scroll_4Frames LITERAL1 45 | Scroll_5Frames LITERAL1 46 | Scroll_25Frames LITERAL1 47 | Scroll_64Frames LITERAL1 48 | Scroll_128Frames LITERAL1 49 | Scroll_256Frames LITERAL1 50 | 51 | ####################################### 52 | # Instances (KEYWORD2) 53 | ####################################### 54 | 55 | ACROBOTIC_SSD1306 KEYWORD2 56 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=ACROBOTIC SSD1306 2 | version=1.0.2 3 | author=ACROBOTIC 4 | maintainer=ACROBOTIC 5 | sentence=Library for SSD1306-powered OLED 128x64 displays! 6 | paragraph=This is a library for displaying text and images in SSD1306-powered OLED 128x64 displays; includes support for the ESP8266 SoC! 7 | category=Display 8 | url=https://github.com/acrobotic/Ai_Ardulib_SSD1306 9 | architectures=* 10 | --------------------------------------------------------------------------------