sparkfun / HyperDisplay_UG2856KLBAG01_ArduinoLibrary

This is a HyperDisplay level 3 driver for the Transparent Graphical OLED
https://www.sparkfun.com/
Other
7 stars 7 forks source link

Potential Incompatibility with Arduino Nano Every #1

Closed gmunga5 closed 4 years ago

gmunga5 commented 4 years ago

Subject of the issue

So I am working on a project using the transparent OLED breakout. Initially my plan was to connect it to an arduino nano but after attempting to run it I discovered that there wasn't enough dynamic memory available on the Nano for it to run. So I did some research and decided to update to a Nano every. The Nano every works on the ATMega4809 AVR processor and has 6kb of SRAM which should be plenty for my needs however I started encountering a new issue. I have done some experimentation and I only get this issue compiling for the every.

Your workbench

My setup currently is just the arduino connected to the IIC - Qwick break out and then the Qwick to the Breakout board. The Arduino is currently just connected to the PC.

Steps to reproduce

If you add the every to the list of boards through the board manager and try compiling any of the example codes you may see a similar issue.

Expected behaviour

The code should compile successfully

Actual behaviour

The code does not compile and produces the attached error log.

Code.txt

Error Log.txt

oclyke commented 4 years ago

@gmunga5 Thanks a bunch for the detailed report. Issue was automatically closed because I said it was fixed in d182dc9. A new release of the library should be available in the library manager soon. Please let me know if there is any more trouble

gmunga5 commented 4 years ago

Hi. Thanks for fixing that. It does seem to compile now, however I have noticed that when I run it there seems to be a point where it stops running. From a bit of testing I believe this is the line that it stops at.

myTOLED.begin(WIRE_PORT, false, SSD1309_ARD_UNUSED_PIN)

It appears that part of this line was updated in the library to resolve the previous issue. Would it be that this line now just needs an extra detail of some kind or would there be another issue?

Thanks.

oclyke commented 4 years ago

@gmunga5 I reviewed the code for myTOLED.begin(WIRE_PORT, false, SSD1309_ARD_UNUSED_PIN); and couldn't identify any places where I would expect it to hang. Can you potentially get a finer resolution of where your error occurs? Some ways to do that:

gmunga5 commented 4 years ago

Hi, So I have done a bit more testing after seeing your reply. I can't tell why it was sticking either but now it is getting past the initial set up. When using the test code the line, rectangle and circle functions all work properly. I have noticed that for some reason the display is refusing to print text.

myTOLED.clearDisplay(); myTOLED.setTextCursor(0,0); myTOLED.print("Hello world"); delay(3000);

This is the code I have used to try and get it to print text. I have included it within the line function. From what I can see the line function works as intended, then there is a blank screen and a pause and then the rectangle function starts. You wouldn't have any idea what could be causing this issue or any way to resolve it would you?

Thanks again for all your help with this.

gmunga5 commented 4 years ago

Just wanted to add a further comment in regards to the text. From what I can see it works when printed on top of pixels. So I would guess that means it is working but is turning the text pixels off instead of on.

image This should be visible here.

oclyke commented 4 years ago

Text printing relies on the current window's color settings. Previously the default window settings left the color unset which caused this odd behavior. To see this in action you can try this code (in your text test function):

// Define a color for 'on'
SSD1309_Bite_t on;
on.bite=0xFF;

//// Define a color for 'off'
//SSD1309_Bite_t off;
//off.bite=0x00;

// Blue Text Black Background
myTOLED.windowClear();
myTOLED.setCurrentWindowColorSequence((color_t)(&on));

//// Black Text Blue Background
//myTOLED.windowSet();
//myTOLED.setCurrentWindowColorSequence((color_t)(&off));

// Print text using window settings
myTOLED.setTextCursor(0,0);
myTOLED.print("Hello world");

I also just pushed/released changes to the library that make it much easier. Get v1.1.0 of the library from the Arduino library manager and check out Example4_Text

oclyke commented 4 years ago

Not sure how long it will take Arduino to pick up the changes and put them into the Library Manager. To try it out sooner you could clone/download the two changed libraries directly: Transparent GOLED SSD1309 Driver