INFO: Dieses Forum nutzt Cookies...
Cookies sind für den Betrieb des Forums unverzichtbar. Mit der Nutzung des Forums erklärst Du dich damit einverstanden, dass wir Cookies verwenden.

Es wird in jedem Fall ein Cookie gesetzt um diesen Hinweis nicht mehr zu erhalten. Desweiteren setzen wir Google Adsense und Google Analytics ein.

Antwort schreiben 
 
Themabewertung:
  • 0 Bewertungen - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
2,3" monochorme 128x32 Display
24.12.2020, 17:31
Beitrag #1
2,3" monochorme 128x32 Display
Hallo zusammen und frohe Weihnachten,

ich habe ein kleines Problem....

das Projekt das ich gerade bearbeitet hatte ich vor ca. einem Jahr schon mal angefangen und dann wieder zur Seite gelegt(da hat auch alles so weit funktioniert).
Nun wollte ich neu starten und habe den alten Sketch mit dem ich damals angefangen habe auf den Nanon hochgeladen...hab es vorher auch mit nem UNO getestet.....

Jetzt das Problem, obwohl ich in allen libs die ich finden konnte die in dem Sketch involviert sind und mit der Displaygrösse zu tun haben, 128x32 Pixel eingestellt habe.....wird mir die bitmap und auch alles andere für eine Displaygrösse von 128x64 angezeigt.....also nur die untere Hälfte von dem was eigentlich auf das ganze Display sollte.......

Hier mal der Sketch......hab ich da noch einen Fehler übersehen?

Code:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <U8g2_for_Adafruit_GFX.h>

#define SCREEN_WIDTH 128
#define SCREEN_HIGHT  32

#define OLED_MOSI   11
#define OLED_CLK   13
#define OLED_DC    8
#define OLED_CS    10
#define OLED_RESET 9
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

U8G2_FOR_ADAFRUIT_GFX disp;
#pragma once
#define ZW1IXR_BMPWIDTH  128
#define ZW1IXR_BMPHEIGHT 32
const unsigned char bitmap_zw1ixr[] PROGMEM = {
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0001,B11100000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0011,B11111100,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0110,B00011110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00011111,B00000000,B0000​1100,B00111000,B00000000,B11111000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00111111,B11100000,B0011​1000,B01111100,B00000111,B11111100,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B01111111,B11111100,B0111​0000,B11000111,B00111111,B11111110,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11110011,B11111111,B1100​0000,B00001111,B11111111,B11001111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11100110,B01111111,B1001​1111,B11111111,B11111110,B01100111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11100100,B01001110,B0000​1111,B11111000,B01110010,B00100111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11101100,B11001000,B0000​0000,B00000000,B00010011,B00110111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11101000,B10011000,B0010​0010,B01000100,B00011001,B00010111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B11111001,B10010001,B1000​1000,B00010001,B10001001,B10011111,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B01110001,B00110011,B1001​1100,B00111001,B11001100,B10001110,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B01110011,B00100111,B1001​1100,B00111001,B11100100,B11001110,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00110010,B01100111,B1001​1100,B00111001,B11100110,B01001100,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00110110,B01001111,B1001​1100,B00111001,B11110010,B01101100,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,B11001111,B1001​1100,B00111001,B11110011,B00111000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00011100,B10011111,B1101​1100,B00111011,B11111001,B00111000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B10011111,B1111​1100,B00111111,B11111001,B11110000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00001111,B11111111,B1111​1100,B00111111,B11111111,B11110000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000111,B11100111,B1111​1110,B01111111,B11100111,B11100000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11100011,B1111​1111,B11111111,B11000111,B11000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000011,B11110011,B1111​1111,B11111111,B11001111,B11000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000001,B11110001,B1001​1111,B11111001,B10001111,B10000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B01100000,B0011​1111,B11111100,B00000110,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0111​1111,B11111110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B1111​1110,B01111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B1111​1100,B00111111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0111​0000,B00001110,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,
  B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B0000​0000
};
int a = 25;
int b = 50;



void setup() {
  // put your setup code here, to run once:
  display.begin(SSD1306_SWITCHCAPVCC);
  disp.begin(display);
  disp.setFontMode(1);
  disp.setFontDirection(0);
  disp.setForegroundColor(WHITE);

  lawgiver();
  dispbasis();

}

void loop() {
  // put your main code here, to run repeatedly:disp.setCursor(29,30);
disp.println(a);
disp.setCursor(53,30);
disp.println(a);
disp.setCursor(79,30);
disp.println(a);
disp.setCursor(104,30);
disp.println(b);
display.display();

}

void lawgiver(void) {
  display.clearDisplay();

  display.drawBitmap(
    (display.width()  - ZW1IXR_BMPWIDTH ) / 2,
    (display.height() - ZW1IXR_BMPHEIGHT) / 2,
    bitmap_zw1ixr, ZW1IXR_BMPWIDTH, ZW1IXR_BMPHEIGHT, 1);
  display.display();
  delay(2000);
}

void dispbasis(void){
display.clearDisplay();

display.drawLine(0,20,128,20,WHITE);
display.drawLine(28,20,28,32,WHITE);
display.drawLine(51,20,51,32,WHITE);
display.drawLine(77,20,77,32,WHITE);
display.drawLine(102,20,102,32,WHITE);
disp.setFont(u8g2_font_5x8_tf);
disp.setCursor(0,30);
disp.println("D:0,0");
disp.setCursor(39,30);
disp.println("ap");
disp.setCursor(63,30);
disp.println("in");
disp.setCursor(89,30);
disp.println("he");
disp.setCursor(114,30);
disp.println("fmj");

display.display();
}
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 17:40
Beitrag #2
RE: 2,3" monochorme 128x32 Display
Gib uns bitte noch Links zu den verwendeten Libs. Evtl. muss man in diesen noch was einstellen.

Gruß Tommy

"Wer den schnellen Erfolg sucht, sollte nicht programmieren, sondern Holz hacken." (Quelle unbekannt)
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 17:44
Beitrag #3
RE: 2,3" monochorme 128x32 Display
OK....mach ich
kann jetzt aber bissi dauern...
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 17:47
Beitrag #4
RE: 2,3" monochorme 128x32 Display
Code:
* @file Adafruit_SSD1306.h
*
* This is part of for Adafruit's SSD1306 library for monochrome
* OLED displays: http://www.adafruit.com/category/63_98
*
* These displays use I2C or SPI to communicate. I2C requires 2 pins
* (SCL+SDA) and optionally a RESET pin. SPI requires 4 pins (MOSI, SCK,
* select, data/command) and optionally a reset pin. Hardware SPI or
* 'bitbang' software SPI are both supported.
*
* Adafruit invests time and resources providing this open source code,
* please support Adafruit and open-source hardware by purchasing
* products from Adafruit!
*
* Written by Limor Fried/Ladyada for Adafruit Industries, with
* contributions from the open source community.
*
* BSD license, all text above, and the splash screen header file,
* must be included in any redistribution.
*
*/

#ifndef _Adafruit_SSD1306_H_
#define _Adafruit_SSD1306_H_

// ONE of the following three lines must be #defined:
//#define SSD1306_128_64 ///< DEPRECTAED: old way to specify 128x64 screen
#define SSD1306_128_32   ///< DEPRECATED: old way to specify 128x32 screen
//#define SSD1306_96_16  ///< DEPRECATED: old way to specify 96x16 screen
// This establishes the screen dimensions in old Adafruit_SSD1306 sketches
// (NEW CODE SHOULD IGNORE THIS, USE THE CONSTRUCTORS THAT ACCEPT WIDTH
// AND HEIGHT ARGUMENTS).

#if defined(ARDUINO_STM32_FEATHER)
  typedef class HardwareSPI SPIClass;
#endif

#include <Wire.h>
#include <SPI.h>
#include <Adafruit_GFX.h>

#if defined(__AVR__)
  typedef volatile uint8_t  PortReg;
  typedef uint8_t           PortMask;
  #define HAVE_PORTREG
#elif defined(__SAM3X8E__)
  typedef volatile RwReg    PortReg;
  typedef uint32_t          PortMask;
  #define HAVE_PORTREG
#elif defined(__arm__) || defined(ARDUINO_FEATHER52)
  typedef volatile uint32_t PortReg;
  typedef uint32_t          PortMask;
  #define HAVE_PORTREG
#endif

#define BLACK                          0 ///< Draw 'off' pixels
#define WHITE                          1 ///< Draw 'on' pixels
#define INVERSE                        2 ///< Invert pixels

#define SSD1306_MEMORYMODE          0x20 ///< See datasheet
#define SSD1306_COLUMNADDR          0x21 ///< See datasheet
#define SSD1306_PAGEADDR            0x22 ///< See datasheet
#define SSD1306_SETCONTRAST         0x81 ///< See datasheet
#define SSD1306_CHARGEPUMP          0x8D ///< See datasheet
#define SSD1306_SEGREMAP            0xA0 ///< See datasheet
#define SSD1306_DISPLAYALLON_RESUME 0xA4 ///< See datasheet
#define SSD1306_DISPLAYALLON        0xA5 ///< Not currently used
#define SSD1306_NORMALDISPLAY       0xA6 ///< See datasheet
#define SSD1306_INVERTDISPLAY       0xA7 ///< See datasheet
#define SSD1306_SETMULTIPLEX        0xA8 ///< See datasheet
#define SSD1306_DISPLAYOFF          0xAE ///< See datasheet
#define SSD1306_DISPLAYON           0xAF ///< See datasheet
#define SSD1306_COMSCANINC          0xC0 ///< Not currently used
#define SSD1306_COMSCANDEC          0xC8 ///< See datasheet
#define SSD1306_SETDISPLAYOFFSET    0xD3 ///< See datasheet
#define SSD1306_SETDISPLAYCLOCKDIV  0xD5 ///< See datasheet
#define SSD1306_SETPRECHARGE        0xD9 ///< See datasheet
#define SSD1306_SETCOMPINS          0xDA ///< See datasheet
#define SSD1306_SETVCOMDETECT       0xDB ///< See datasheet

#define SSD1306_SETLOWCOLUMN        0x00 ///< Not currently used
#define SSD1306_SETHIGHCOLUMN       0x10 ///< Not currently used
#define SSD1306_SETSTARTLINE        0x40 ///< See datasheet

#define SSD1306_EXTERNALVCC         0x01 ///< External display voltage source
#define SSD1306_SWITCHCAPVCC        0x02 ///< Gen. display voltage from 3.3V

#define SSD1306_RIGHT_HORIZONTAL_SCROLL              0x26 ///< Init rt scroll
#define SSD1306_LEFT_HORIZONTAL_SCROLL               0x27 ///< Init left scroll
#define SSD1306_VERTICAL_AND_RIGHT_HORIZONTAL_SCROLL 0x29 ///< Init diag scroll
#define SSD1306_VERTICAL_AND_LEFT_HORIZONTAL_SCROLL  0x2A ///< Init diag scroll
#define SSD1306_DEACTIVATE_SCROLL                    0x2E ///< Stop scroll
#define SSD1306_ACTIVATE_SCROLL                      0x2F ///< Start scroll
#define SSD1306_SET_VERTICAL_SCROLL_AREA             0xA3 ///< Set scroll range

// Deprecated size stuff for backwards compatibility with old sketches
#if defined SSD1306_128_64
#define SSD1306_LCDWIDTH  128 ///< DEPRECATED: width w/SSD1306_128_64 defined
#define SSD1306_LCDHEIGHT  64 ///< DEPRECATED: height w/SSD1306_128_64 defined
#endif
#if defined SSD1306_128_32
#define SSD1306_LCDWIDTH  128 ///< DEPRECATED: width w/SSD1306_128_32 defined
#define SSD1306_LCDHEIGHT  32 ///< DEPRECATED: height w/SSD1306_128_32 defined
#endif
#if defined SSD1306_96_16
#define SSD1306_LCDWIDTH   96 ///< DEPRECATED: width w/SSD1306_96_16 defined
#define SSD1306_LCDHEIGHT  16 ///< DEPRECATED: height w/SSD1306_96_16 defined
#endif

/*!
    @brief  Class that stores state and functions for interacting with
            SSD1306 OLED displays.
*/
class Adafruit_SSD1306 : public Adafruit_GFX {
public:
  // NEW CONSTRUCTORS -- recommended for new projects
  Adafruit_SSD1306(uint8_t w, uint8_t h, TwoWire *twi=&Wire, int8_t rst_pin=-1,
    uint32_t clkDuring=400000UL, uint32_t clkAfter=100000UL);
  Adafruit_SSD1306(uint8_t w, uint8_t h, int8_t mosi_pin, int8_t sclk_pin,
    int8_t dc_pin, int8_t rst_pin, int8_t cs_pin);
  Adafruit_SSD1306(uint8_t w, uint8_t h, SPIClass *spi,
    int8_t dc_pin, int8_t rst_pin, int8_t cs_pin, uint32_t bitrate=8000000UL);

  // DEPRECATED CONSTRUCTORS - for back compatibility, avoid in new projects
  Adafruit_SSD1306(int8_t mosi_pin, int8_t sclk_pin, int8_t dc_pin,
    int8_t rst_pin, int8_t cs_pin);
  Adafruit_SSD1306(int8_t dc_pin, int8_t rst_pin, int8_t cs_pin);
  Adafruit_SSD1306(int8_t rst_pin = -1);

  ~Adafruit_SSD1306(void);

  boolean      begin(uint8_t switchvcc=SSD1306_SWITCHCAPVCC,
                 uint8_t i2caddr=0, boolean reset=true,
                 boolean periphBegin=true);
  void         display(void);
  void         clearDisplay(void);
  void         invertDisplay(boolean i);
  void         dim(boolean dim);
  void         drawPixel(int16_t x, int16_t y, uint16_t color);
  virtual void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
  virtual void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
  void         startscrollright(uint8_t start, uint8_t stop);
  void         startscrollleft(uint8_t start, uint8_t stop);
  void         startscrolldiagright(uint8_t start, uint8_t stop);
  void         startscrolldiagleft(uint8_t start, uint8_t stop);
  void         stopscroll(void);
  void         ssd1306_command(uint8_t c);
  boolean      getPixel(int16_t x, int16_t y);
  uint8_t     *getBuffer(void);

private:
  inline void  SPIwrite(uint8_t d) __attribute__((always_inline));
  void         drawFastHLineInternal(int16_t x, int16_t y, int16_t w,
                 uint16_t color);
  void         drawFastVLineInternal(int16_t x, int16_t y, int16_t h,
                 uint16_t color);
  void         ssd1306_command1(uint8_t c);
  void         ssd1306_commandList(const uint8_t *c, uint8_t n);

  SPIClass    *spi;
  TwoWire     *wire;
  uint8_t     *buffer;
  int8_t       i2caddr, vccstate, page_end;
  int8_t       mosiPin    ,  clkPin    ,  dcPin    ,  csPin, rstPin;
#ifdef HAVE_PORTREG
  PortReg     *mosiPort   , *clkPort   , *dcPort   , *csPort;
  PortMask     mosiPinMask,  clkPinMask,  dcPinMask,  csPinMask;
#endif
#if defined(SPI_HAS_TRANSACTION)
  SPISettings  spiSettings;
#endif
#if ARDUINO >= 157
  uint32_t     wireClk;    // Wire speed for SSD1306 transfers
  uint32_t     restoreClk; // Wire speed following SSD1306 transfers
#endif
};

#endif // _Adafruit_SSD1306_H_
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 17:49
Beitrag #5
RE: 2,3" monochorme 128x32 Display
Code:
#ifndef _ADAFRUIT_GFX_H
#define _ADAFRUIT_GFX_H

#if ARDUINO >= 100
#include "Arduino.h"
#include "Print.h"
#else
#include "WProgram.h"
#endif
#include "gfxfont.h"

class Adafruit_GFX : public Print {

public:

  Adafruit_GFX(int16_t w, int16_t h); // Constructor

  // This MUST be defined by the subclass:
  virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;

  // TRANSACTION API / CORE DRAW API
  // These MAY be overridden by the subclass to provide device-specific
  // optimized code.  Otherwise 'generic' versions are used.
  virtual void startWrite(void);
  virtual void writePixel(int16_t x, int16_t y, uint16_t color);
  virtual void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);
  virtual void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color);
  virtual void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);
  virtual void writeLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color);
  virtual void endWrite(void);

  // CONTROL API
  // These MAY be overridden by the subclass to provide device-specific
  // optimized code.  Otherwise 'generic' versions are used.
  virtual void setRotation(uint8_t r);
  virtual void invertDisplay(boolean i);

  // BASIC DRAW API
  // These MAY be overridden by the subclass to provide device-specific
  // optimized code.  Otherwise 'generic' versions are used.
  virtual void
    // It's good to implement those, even if using transaction API
    drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color),
    drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color),
    fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color),
    fillScreen(uint16_t color),
    // Optional and probably not necessary to change
    drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color),
    drawRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color);

  // These exist only with Adafruit_GFX (no subclass overrides)
  void
    drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color),
    drawCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
      uint16_t color),
    fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color),
    fillCircleHelper(int16_t x0, int16_t y0, int16_t r, uint8_t cornername,
      int16_t delta, uint16_t color),
    drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
      int16_t x2, int16_t y2, uint16_t color),
    fillTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1,
      int16_t x2, int16_t y2, uint16_t color),
    drawRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
      int16_t radius, uint16_t color),
    fillRoundRect(int16_t x0, int16_t y0, int16_t w, int16_t h,
      int16_t radius, uint16_t color),
    drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
      int16_t w, int16_t h, uint16_t color),
    drawBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
      int16_t w, int16_t h, uint16_t color, uint16_t bg),
    drawBitmap(int16_t x, int16_t y, uint8_t *bitmap,
      int16_t w, int16_t h, uint16_t color),
    drawBitmap(int16_t x, int16_t y, uint8_t *bitmap,
      int16_t w, int16_t h, uint16_t color, uint16_t bg),
    drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
      int16_t w, int16_t h, uint16_t color),
    drawGrayscaleBitmap(int16_t x, int16_t y, const uint8_t bitmap[],
      int16_t w, int16_t h),
    drawGrayscaleBitmap(int16_t x, int16_t y, uint8_t *bitmap,
      int16_t w, int16_t h),
    drawGrayscaleBitmap(int16_t x, int16_t y,
      const uint8_t bitmap[], const uint8_t mask[],
      int16_t w, int16_t h),
    drawGrayscaleBitmap(int16_t x, int16_t y,
      uint8_t *bitmap, uint8_t *mask, int16_t w, int16_t h),
    drawRGBBitmap(int16_t x, int16_t y, const uint16_t bitmap[],
      int16_t w, int16_t h),
    drawRGBBitmap(int16_t x, int16_t y, uint16_t *bitmap,
      int16_t w, int16_t h),
    drawRGBBitmap(int16_t x, int16_t y,
      const uint16_t bitmap[], const uint8_t mask[],
      int16_t w, int16_t h),
    drawRGBBitmap(int16_t x, int16_t y,
      uint16_t *bitmap, uint8_t *mask, int16_t w, int16_t h),
    drawChar(int16_t x, int16_t y, unsigned char c, uint16_t color,
      uint16_t bg, uint8_t size),
    setCursor(int16_t x, int16_t y),
    setTextColor(uint16_t c),
    setTextColor(uint16_t c, uint16_t bg),
    setTextSize(uint8_t s),
    setTextWrap(boolean w),
    cp437(boolean x=true),
    setFont(const GFXfont *f = NULL),
    getTextBounds(char *string, int16_t x, int16_t y,
      int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h),
    getTextBounds(const __FlashStringHelper *s, int16_t x, int16_t y,
      int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h);

#if ARDUINO >= 100
  virtual size_t write(uint8_t);
#else
  virtual void   write(uint8_t);
#endif

  int16_t height(void) const;
  int16_t width(void) const;

  uint8_t getRotation(void) const;

  // get current cursor position (get rotation safe maximum values, using: width() for x, height() for y)
  int16_t getCursorX(void) const;
  int16_t getCursorY(void) const;

protected:
  void
    charBounds(char c, int16_t *x, int16_t *y,
      int16_t *minx, int16_t *miny, int16_t *maxx, int16_t *maxy);
  const int16_t
    WIDTH, HEIGHT;   // This is the 'raw' display w/h - never changes
  int16_t
    _width, _height, // Display w/h as modified by current rotation
    cursor_x, cursor_y;
  uint16_t
    textcolor, textbgcolor;
  uint8_t
    textsize,
    rotation;
  boolean
    wrap,   // If set, 'wrap' text at right edge of display
    _cp437; // If set, use correct CP437 charset (default is off)
  GFXfont
    *gfxFont;
};

class Adafruit_GFX_Button {

public:
  Adafruit_GFX_Button(void);
  // "Classic" initButton() uses center & size
  void initButton(Adafruit_GFX *gfx, int16_t x, int16_t y,
   uint16_t w, uint16_t h, uint16_t outline, uint16_t fill,
   uint16_t textcolor, char *label, uint8_t textsize);
  // New/alt initButton() uses upper-left corner & size
  void initButtonUL(Adafruit_GFX *gfx, int16_t x1, int16_t y1,
   uint16_t w, uint16_t h, uint16_t outline, uint16_t fill,
   uint16_t textcolor, char *label, uint8_t textsize);
  void drawButton(boolean inverted = false);
  boolean contains(int16_t x, int16_t y);

  void press(boolean p);
  boolean isPressed();
  boolean justPressed();
  boolean justReleased();

private:
  Adafruit_GFX *_gfx;
  int16_t       _x1, _y1; // Coordinates of top-left corner
  uint16_t      _w, _h;
  uint8_t       _textsize;
  uint16_t      _outlinecolor, _fillcolor, _textcolor;
  char          _label[10];

  boolean currstate, laststate;
};

class GFXcanvas1 : public Adafruit_GFX {
public:
  GFXcanvas1(uint16_t w, uint16_t h);
  ~GFXcanvas1(void);
  void     drawPixel(int16_t x, int16_t y, uint16_t color),
           fillScreen(uint16_t color);
  uint8_t *getBuffer(void);
private:
  uint8_t *buffer;
};

class GFXcanvas8 : public Adafruit_GFX {
public:
  GFXcanvas8(uint16_t w, uint16_t h);
  ~GFXcanvas8(void);
  void     drawPixel(int16_t x, int16_t y, uint16_t color),
           fillScreen(uint16_t color),
           writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color);

  uint8_t *getBuffer(void);
private:
  uint8_t *buffer;
};

class GFXcanvas16 : public Adafruit_GFX {
public:
  GFXcanvas16(uint16_t w, uint16_t h);
  ~GFXcanvas16(void);
  void      drawPixel(int16_t x, int16_t y, uint16_t color),
            fillScreen(uint16_t color);
  uint16_t *getBuffer(void);
private:
  uint16_t *buffer;
};

#endif // _ADAFRUIT_GFX_H
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 17:59
Beitrag #6
RE: 2,3" monochorme 128x32 Display
Du weißt was ein Link ist?

Schau mal in die

Code:
// This establishes the screen dimensions in old Adafruit_SSD1306 sketches
// (NEW CODE SHOULD IGNORE THIS, USE THE CONSTRUCTORS THAT ACCEPT WIDTH
// AND HEIGHT ARGUMENTS).

Probiere mal diesen neuen Constructor (ungetestet):
Code:
// Dein Code
  Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
// neu
  Adafruit_SSD1306 display(128, 32, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);

Gruß Tommy

"Wer den schnellen Erfolg sucht, sollte nicht programmieren, sondern Holz hacken." (Quelle unbekannt)
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 18:03
Beitrag #7
RE: 2,3" monochorme 128x32 Display
ein Link ist ein Pfad über den man auf eine Seite kommt.....
Richtig?
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
24.12.2020, 18:05
Beitrag #8
RE: 2,3" monochorme 128x32 Display
https://github.com/adafruit/Adafruit_SSD1306
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
Antwort schreiben 


Möglicherweise verwandte Themen...
Thema: Verfasser Antworten: Ansichten: Letzter Beitrag
  Laserwert auf OLED Display ausgeben Blauepi 18 857 22.03.2021 14:00
Letzter Beitrag: Blauepi
  TFT-LCD-Display (Extension) phg 3 404 13.03.2021 19:26
Letzter Beitrag: Tommy56
  SH1107 Oled Display und Multiplexer Feuchtigkeitssteuerung Kanka 35 2.077 06.02.2021 22:38
Letzter Beitrag: Kanka
  Werte im Display per Taster wechseln bmxruler 8 672 27.01.2021 11:22
Letzter Beitrag: bmxruler
  Kompiler beschwert sich nicht, LC-Display macht aber nicht, was es soll. generic_user492 3 404 26.01.2021 14:11
Letzter Beitrag: MicroBahner
  Problem Arduino Mega und Nextion Touch Display pds14 9 1.191 28.10.2020 11:20
Letzter Beitrag: hotsystems
  Rotary Encoder und I2C Display gleichzeitig verwenden BenGroll 3 1.113 27.07.2020 10:23
Letzter Beitrag: hotsystems
Wink Arduino TFT Display MEGA 2560 Samsuino 48 18.371 23.07.2020 15:45
Letzter Beitrag: sam_217
  OLED Display Phänomen Sulawesi 36 4.012 02.06.2020 13:06
Letzter Beitrag: Sulawesi
  7 Segment Display mit Rotary Encoder SA154 2 928 26.05.2020 13:40
Letzter Beitrag: MicroBahner

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste