XRAD
Well-known member
Hello All, I have tried different pin configs in software and hardware for the OLED. I have tried several SSD1309 libs as well as the DFRobot lib...nothing works...
hardware:
DFRobot 1.5" translucent OLED
Teensy 3.2
https://wiki.dfrobot.com/SKU_DFR093...rent_Display_with_Converter_Breakout#target_0
The ribbon cable is attached as per DFRobot diagram. 5v to OLED board.
Tried all the DFRobot examples (that came with their lib..)...and a few others...here are sample codes
Any help appreciated very much, THX!
hardware:
DFRobot 1.5" translucent OLED
Teensy 3.2
https://wiki.dfrobot.com/SKU_DFR093...rent_Display_with_Converter_Breakout#target_0
The ribbon cable is attached as per DFRobot diagram. 5v to OLED board.
Tried all the DFRobot examples (that came with their lib..)...and a few others...here are sample codes
Any help appreciated very much, THX!
Code:
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>
U8G2_SSD1309_128X64_NONAME0_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
void setup(void) {
u8g2.begin();
}
void loop(void) {
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0,10,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
delay(1000);
}
Code:
/*!
* @file HelloWorld.ino
* @brief 简单又经典的Hello World!显示
* @n U8G2支持多种大小的字体,此demo只是选取1种字体大小进行显示"Hello World!"
* @n U8G2字体GitHub连接:https://github.com/olikraus/u8g2/wiki/fntlistall
*
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author [Ivey](Ivey.lu@dfrobot.com)
* @maintainer [Fary](feng.yang@dfrobot.com)
* @version V1.0
* @date 2019-10-15
* @url https://github.com/DFRobot/U8g2_Arduino
*/
//#include <Arduino.h>
#include <U8g2lib.h>
//#include <SPI.h>
/*
* Display hardware IIC interface constructor
*@param rotation:U8G2_R0 Not rotate, horizontally, draw direction from left to right
U8G2_R1 Rotate clockwise 90 degrees, drawing direction from top to bottom
U8G2_R2 Rotate 180 degrees clockwise, drawing in right-to-left directions
U8G2_R3 Rotate clockwise 270 degrees, drawing direction from bottom to top
U8G2_MIRROR Normal display of mirror content (v2.6.x version used above)
Note: U8G2_MIRROR need to be used with setFlipMode().
*@param reset:U8x8_PIN_NONE Indicates that the pin is empty and no reset pin is used
* Display hardware SPI interface constructor
*@param Just connect the CS pin (pins are optional)
*@param Just connect the DC pin (pins are optional)
*
*/
/*
#define OLED_DC 9
#define OLED_CS 10
#define OLED_RST 8
#define OLED_MISO 12
#define OLED_MOSI 11
#define OLED_SCK 13
*/
//U8G2_SSD1309_128X64_NONAME2_1_4W_HW_SPI u8g2(/* rotation=*/U8G2_R0, /* cs=*/ OLED_CS, /* dc=*/ OLED_DC,/* reset=*/OLED_RST);
U8G2_SSD1309_128X64_NONAME2_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);
void setup(void) {
u8g2.begin();
u8g2.setFontPosTop();
}
void loop(void) {
u8g2.firstPage();
do
{
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_t0_17b_tr ); // choose a suitable font
u8g2.drawStr(0,5,"Hello World!"); // write something to the internal memory
u8g2.sendBuffer(); // transfer internal memory to the display
} while( u8g2.nextPage() );
delay(2000);
}