![]() ![]() Replace u8x8 with your display reference, and address with the I2C bus address (for example. Then use the following line in void setup(): tI2CAddress(address) ![]() It’s an I2C scanner tool that will return the I2C bus display. To do this, wire up your OLED then run this sketch (open the serial monitor for results). If the display did not work – you may need to manually set the I2C bus address. Your display should go through the demonstration of various things as shown in the video below: Now it’s time to check everything necessary is working. Open a new sketch in the IDE, then copy and paste the following sketch into the IDE: // Display > #include #include #ifdef U8X8_HAVE_HW_SPI #include #endif #ifdef U8X8_HAVE_HW_I2C #include #endif U8X8_SSD1306_128X64_NONAME_HW_I2C u8x8 ( /* reset=*/ U8X8_PIN_NONE ) /* This example will probably not work with the SSD1606, because of the internal buffer swapping */ void setup ( void ) Click on the library then click “Install”:Īfter a moment the library will be installed and you can close that box. Enter “u8g2” in the search box, and after a moment it should appear in the results as shown in the image below. To install the library – simply open the Arduino IDE and select Manage Libraries… from the Tools menu. If you can’t find your I2C pins on other boards, ask your display supplier. Arduino Mega uses D20/D21 for SDA and SCL. Arduino Leonard uses D2/D3 for SDA and SCL or the separate pins to the left of D13. The display uses the I2C data bus for communication, and is a 5V and 3.3V-tolerant board.ĥV/3.3V- Vcc (power supply, can be 3.3V or 5V) This includes installing the Arduino library, making a succesful board connection and running a demonstration sketch. The purpose of this guide is to have an SSD1306-based OLED display successfully operating with your Arduino, so you can move forward and experiment and explore further types of operation with the display. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |