Hello from Turkey, Connecting OLED display to Blue Pill

Post Reply
adembudak
Posts: 6
Joined: Fri Feb 02, 2018 1:12 am
Location: Turkey

Hello from Turkey, Connecting OLED display to Blue Pill

Post by adembudak » Tue Feb 13, 2018 2:54 am

Hello everyone,

After lots of trouble I manage to load bootloader to Blue Pill and now I try to connect this thing to see something visual:
The OLED display 4 pin i2c 0.96 inch.Image

The connections to STM32F103C8T6

OLED Display -> Board

Code: Select all

VCC  -> 3V3
GND  ->  G
SCL  -> PB6
SDA  ->  PB7
Thanks for all answerers in advance.

User avatar
bilekj
Posts: 2
Joined: Mon Feb 12, 2018 6:26 pm
Location: Prague, Czech Republic

Re: Hello from Turkey, Connecting OLED display to Blue Pill

Post by bilekj » Tue Feb 13, 2018 7:05 am

Hi,
this is my testing sketch:

Code: Select all

/*
 * Test OLED display 1306 pixel size 128x64, 0.96 inch
 * Interface I2C
 * Important! Define SSD1306_128_64 in Adafruit_SSD1306_STM32.h
 * 
 * Wiring: SCLK  .. B6
 *         SDA   .. B7
 *         
 *         
 */

#include <Wire.h>
#include <Adafruit_SSD1306_STM32.h>
#include <fonts\FreeMono12pt7b.h>

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

//------------

#define OLED_RESET -1  // Not used
Adafruit_SSD1306 display(OLED_RESET);


//------------
void setup() {
  // Serial.begin(115200);

  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 128x64)
  // init done

  // Clear the buffer.
  display.clearDisplay();

  // Draw a test
  display.clearDisplay();
  display.setTextSize(1);
  display.setTextColor(WHITE);
  display.setCursor(0,0);
  display.println("OLED Display 128x64");
  display.setFont(&FreeMono12pt7b);
  display.drawPixel(0,45,WHITE);
  display.setCursor(4,45);
  display.println("Welcome!");
  display.display();
}

//------------
void loop() {
  // put your main code here, to run repeatedly:

}
Hope it will work for you.
Jiri

adembudak
Posts: 6
Joined: Fri Feb 02, 2018 1:12 am
Location: Turkey

Re: Hello from Turkey, Connecting OLED display to Blue Pill

Post by adembudak » Tue Feb 13, 2018 7:24 am

Thank you for your answer @bilekj,
And need to say sorry for the huge picture, i couldn't mark it up more smaller. For the issue, i make small wiring mistake, I confuse the place of pin SDL and pin SCK after change them the issue is fixed. I download https://github.com/olikraus/u8g2 u8g2 library and upload one of its example sketch. It works now///.

Post Reply