SSD1306 support

pull/3/head
Dirk Niggemann 5 years ago
parent 1805cd5325
commit e4e5eb7ef6
  1. 4
      Disp_Plus.h
  2. 19
      UI.hpp
  3. 2
      config.h

@ -70,8 +70,8 @@ class Disp_Plus : public T
strncpy(s, str, l);
//setCursor(pos_x * getMaxCharWidth(), pos_y * getMaxCharHeight());
setCursor(pos_x, pos_y );
print(tmp);
this->setCursor(pos_x, pos_y );
this->print(tmp);
#ifdef DEBUG
Serial.print(pos_y, DEC);

@ -27,12 +27,14 @@
#define _UI_HPP_
#include "config.h"
#ifdef I2C_DISPLAY
#include "Disp_Plus.h"
/* #ifdef I2C_DISPLAY
#include "LiquidCrystalPlus_I2C.h"
#endif
#ifdef U8X8_DISPLAY
#include "SSD1322_Plus.h"
#endif
*/
#include <LCDMenuLib2.h>
#include <Encoder.h>
@ -67,11 +69,22 @@ extern value_change_t soften_filter_cut;
elapsedMillis back_from_volume;
#ifdef I2C_DISPLAY
LiquidCrystalPlus_I2C lcd(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows);
#include <LiquidCrystal_I2C.h>
//LiquidCrystalPlus_I2C lcd(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows);
Disp_Plus<LiquidCrystal_I2C> lcd(LCD_I2C_ADDRESS, _LCDML_DISP_cols, _LCDML_DISP_rows);
#endif
#ifdef U8X8_DISPLAY
SSD1322_Plus lcd(/* cs=*/ U8X8_CS_PIN, /* dc=*/ U8X8_DC_PIN, /* reset=*/ U8X8_RESET_PIN);
#include <U8x8lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
//SSD1322_Plus lcd(/* cs=*/ U8X8_CS_PIN, /* dc=*/ U8X8_DC_PIN, /* reset=*/ U8X8_RESET_PIN);
Disp_Plus<U8X8_DISPLAY_CLASS> lcd(/* cs=*/ U8X8_CS_PIN, /* dc=*/ U8X8_DC_PIN, /* reset=*/ U8X8_RESET_PIN);
//Disp_Plus<U8X8_DISPLAY_CLASS> lcd(U8X8_PIN_NONE);
#endif
const uint8_t scroll_bar[5][8] = {

@ -115,6 +115,8 @@
// LCD Display
#define U8X8_DISPLAY
#define U8X8_DISPLAY_CLASS U8X8_SSD1322_NHD_256X64_4W_HW_SPI
//#define U8X8_DISPLAY_CLASS U8X8_SSD1306_128X64_NONAME_HW_I2C
#define U8X8_CS_PIN 9
#define U8X8_DC_PIN 15
#define U8X8_RESET_PIN 14

Loading…
Cancel
Save