Using an 1.3' OLED I2C Screen

Moderators: mdrjr, odroid

Using an 1.3' OLED I2C Screen

Unread postby carlosed127 » Wed May 24, 2017 5:16 am

Hi to all, I'm having problems making this setup work with Android.

I've followed this tutorial and I can make the tinkering example project work but the thing is that now I want to use this screen with Android but I honestly have no Idea where to continue. What should I do now?
Thank you very much for the help.
carlosed127
 
Posts: 1
Joined: Wed May 24, 2017 4:24 am
languages_spoken: english

Re: Using an 1.3' OLED I2C Screen

Unread postby tobetter » Wed May 24, 2017 8:35 am

I don't know much about the display, but it's very interesting.

I've downloaded the driver files from https://drive.google.com/drive/folders/ ... k5xTTBwLWM
I've looked through the source code and it seems you must include all source code (*.c | *.cpp) except in the directory examples to be compiled with your project, and change the file utilities/u8g_com_i2c.c which is most important part to use the display. There are 5 functions what you have to change. I believe that only these functions to be ported to ODROID, other functions are not required to change at all except if there is compile error.
void u8g_i2c_init(uint8_t options)
uint8_t u8g_i2c_wait(uint8_t mask, uint8_t pos)
uint8_t u8g_i2c_start(uint8_t sla)
uint8_t u8g_i2c_send_byte(uint8_t data)
void u8g_i2c_stop(void)

But I think you should port them with Android NDK + WiringPi rather than using Android tinkering example since most functions are not JAVA layer. Even if you merge them to Android project as Tinkering example, you cannot display anything from JAVA since there is no API available to print string or images. So you may consider creating JNI layer to extend the API in the code for the display such as 'u8g.drawBitmapP(...)' to JAVA class.

Maybe I am overthinking or wrong, this is my first impression after reading the code.
tobetter
 
Posts: 2086
Joined: Mon Feb 25, 2013 10:55 am
Location: Kitchener, ON, Canada
languages_spoken: Korean, English
ODROIDs: X, X2, U2, U3, XU3, C1


Return to Android

Who is online

Users browsing this forum: No registered users and 1 guest