Go Down

Topic: I need help - 128x64 oled display (Read 87 times) previous topic - next topic

evan230

Hi all

I have a problem, I tried to move a little square on the Y axis (top to bottom), but it does not work , it also moves horizontally X axis (left to right).
I know that the X axis is horizontal and the Y-axis is vertical.
What am I doing wrong?

Thank you!

Code: [Select]
#include <Adafruit_SH1106.h>
#include <Adafruit_GFX.h>

// DISPLAY SETTINGS
#define OLED_ADDRESS 0x3C

// graphics
static const unsigned char PROGMEM squareGfx []={
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00
};

Adafruit_SH1106 display(1);

int YPos=0;


void setup() {
  display.begin(SH1106_SWITCHCAPVCC,OLED_ADDRESS);
}

void loop() {
  display.clearDisplay();
  //display.setTextColor(WHITE);
  display.drawBitmap(YPos,20,squareGfx,8,8,WHITE);
  display.display();
  YPos+=1;
  if(YPos>60)
    YPos=0;
}



david_prentice

Go on,   drawBitmap() has arguments x, y, ...

You are iterating the x position not the y posn.

David.

evan230

How to iterate the Y axis position? I tried 2 hours, I can not figure it out, please tell me. :(

david_prentice

#3
Jul 11, 2018, 07:19 pm Last Edit: Jul 11, 2018, 07:21 pm by david_prentice
Go on.
Code: [Select]
display.drawBitmap(20,  YPos, squareGfx, ...

evan230


Go Up