Comments (14)
// Some hints for heltec wifi lora
#include <Wire.h>
#include <U8x8lib.h>
U8X8_SSD1306_128X64_NONAME_SW_I2C u8x8(/* clock=/ 15, / data=/ 4, / reset= */ 16);
void setup{
pinMode(16, OUTPUT);
digitalWrite(16, LOW); // set GPIO16 low to reset OLED
delay(50);
digitalWrite(16, HIGH); // while OLED is running, must set GPIO16 in high
u8x8.begin();
u8x8.setPowerSave(0);
u8x8.setFont(u8x8_font_chroma48medium8_r);
u8x8.setCursor(0, 0);
u8x8.print("Hello World!");
}
void loop {
}
from ssd1306ascii.
Aggebitter,
Thanks for that, I'll try it. But to clarify, I have the Heltec Wifi Kit 32, NOT the Heltec LoRa Kit. And, more important, I have no trouble getting the board to work with the u8x8 library. It's the SSD1306Ascii library that I can't get to work.
from ssd1306ascii.
Have ju tryed the highlighted reset part?
If it uses the same oled noname ssd1306 as in the LoRa kit that might help.
Had strange issues before I did a manual reset
from ssd1306ascii.
Looks like the Heltec Wifi Kit 32 has the OLED connected to pins SDA = 4, SCL = 15, and RST = 16.
These are not the standard Wire pins. The Wire library uses SDA = 21 and SCL = 22.
The u8x8 library supports software I2C on any pair of pins. That's what SW_I2C means.
I didn't implement software I2C.
from ssd1306ascii.
greiman, that would certainly explain why it wouldn't work. Would you mind implementing the software I2C sometime today? 😀 No? OK - could I add or change a couple lines to your files somewhere to specify those different SDA and SCL pins? Or is it not that simple? Thanks so much! Your library seem so much easier to use - I'd really to be able to us it.
from ssd1306ascii.
No? OK - could I add or change a couple lines to your files somewhere to specify those different SDA and SCL pins? Or is it not that simple? Thanks so much! Your library seem so much easier to use - I'd really to be able to us it.
It looks like the ESP32 Wire library allows you to specify the pins for sda and scl in the Wire.begin() call.
See this link.
Try replacing the Wire.begin() line in the HelloWorldWire example with this:
Wire.begin(4, 15);
This assumes the Heltec Wifi Kit 32 uses standard ESP32 pin numbers.
If this works, it would be possible to modify SSD1306AsciiWire.h to use the second ESP32 I2C controller. This would require reading the code for the ESP32 Wire library.
from ssd1306ascii.
Thank you so very much! I'll give that a try.
from ssd1306ascii.
greiman,
That was it! Wire.begin(4, 15) made "Hello world!" show up. Thanks so much!
from ssd1306ascii.
Hi.
Unfortunately, I'm not as lucky as ba58smith ;-). Replacing Wire.begin () with Wire.begin (4, 15) in HelloWorldWire did not solve the problem of displaying texts (with your library) on Heltec LoRa 32. My module is very similar to Heltec Wifii Kit 32. OLED is also connected by I2C and also via pins SDA = 4, SCL = 15, and RST = 16.
Maybe I should change something else in the HelloWorldWire code?
My / Your code:
// Test for minimum program size.
#include <Wire.h>
#include "SSD1306Ascii.h"
#include "SSD1306AsciiWire.h"
// 0X3C+SA0 - 0x3C or 0x3D
#define I2C_ADDRESS 0x3C
// Define proper RST_PIN if required.
#define RST_PIN 16
SSD1306AsciiWire oled;
//------------------------------------------------------------------------------
void setup() {
Wire.begin(4, 15);
Wire.setClock(400000L);
#if RST_PIN >= 0
oled.begin(&Adafruit128x64, I2C_ADDRESS, RST_PIN);
#else // RST_PIN >= 0
oled.begin(&Adafruit128x64, I2C_ADDRESS);
#endif // RST_PIN >= 0
oled.setFont(System5x7);
oled.clear();
oled.print("Hello world!");
}
//------------------------------------------------------------------------------
void loop() {}
Tomasz
from ssd1306ascii.
I don't see an obvious problem.
I can't find any info about the display. Since I don't have your hardware I can't do any tests.
from ssd1306ascii.
OK. I understand.
The layout of the pins was included in the PDF file in the first comment.
The display is 0.96-inch 128 * 64 dot matrix OLED display, with SSD1306 controller.
The module is https://heltec.org/project/wifi-lora-32/
What other information can help you diagnose the problem?
from ssd1306ascii.
https://github.com/HelTecAutomation/Heltec_ESP32
WiFi_LoRa_32_V2(433,470-510).PDF
from ssd1306ascii.
I looked at the schematic and other info before the last post.
I can't do more with no hardware.
This is from an example that looks for the OLED.
Add these includes:
#include "Arduino.h"
#include "heltec.h"
replace:
Wire.begin(4, 15);
Wire.setClock(400000L);
With:
Heltec.begin(true, false, true);
Wire.begin(SDA_OLED, SCL_OLED);
Try to run this example.
It should give the I2C address. Maybe Heltec used the alternate SSD1306 address.
from ssd1306ascii.
Yes. I have "Hello world!" On the display.
Thank you so much for help.
from ssd1306ascii.
Related Issues (20)
- When using a display with more than 64 pixels in the Y direction, the lcdHeight parameter is ignored. HOT 6
- Changing I2C pins HOT 1
- Arduino Pro Micro 32U4 and oled.clear(); HOT 1
- Some functions seem to need pixels as a parameter and not row/column character numbers? HOT 3
- Is there any function that returns data from the display? (to verify the display is somewhat functional in init) HOT 2
- Issues Initializing Multiple OLEDs HOT 4
- 1.3" SSH1106 Compatibility HOT 1
- How to make 3 lines of text as large as possible HOT 2
- Support for 0.42" OLED 72x40
- Limiting display decimals, float with 1 decimal, not 2, using oled.print HOT 10
- When using the ssd1306AvrI2c library, the avr hangs indefinitely HOT 4
- Is there interest in Supporting the ATTiny1614 et al?
- Display the character ° HOT 2
- degrees celsius symbol HOT 3
- Software i2c HOT 4
- 70x42 OLED ? HOT 8
- Begin() return error if OLED not connected/found. HOT 2
- Text height HOT 2
- Two oled 128x32 sharing the same address 0x3C connected to ESP32
- Compiling error with Arduino nano every (ATMega4809) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssd1306ascii.