Welcome! Log In Create A New Profile

Advanced

DIY Tiny OLED I2C full graphics controller

Posted by enif 
Re: DIY Tiny OLED I2C full graphics controller
December 10, 2017 11:12PM
The SCAD file is commented - but I am sorry, no other explanations for it are available.

And I admit that the technique I used here is somewhat untypical for OpenScad: Essentially, each object consists just of two arrays of blocks, the first one are additive blocks, the second one cavities that are to be cut out. A normal "cube" type block consists just of two entries: the origin point and the size. A cylindrical block consist of the origin followed by an array [direction, radius, height] where direction is (-1 for X, -2 for Y, -3 for Z). Finally there are also optional 3rd , 4th and 5th entries in each block which can be used to specify the value of $fn (i.e. the number of corners used to approximate the cylinder), the level of the block (lower levels are generated/subtracted first) and a condition string (allowing blocks to be only generated under certain conditions).
With this information and the comments in the block list you should at least be able to understand the structure of the objects.

While this is a rather efficient way of coding, I am not sure if it is a good starting point for someone just beginning to learn OpenScad. In this case traditional coding with explicit
calls to cube(), cylinder(), translate(), difference(), etc. is probably much easier...
Re: DIY Tiny OLED I2C full graphics controller
December 29, 2017 12:00AM
Quote
enif
As for the I2C problem on the Arduino Due that caused some conflict when activating simultaneously the I2C OLED (using the U8glib I2C routines) and the I2C EEPROM (using Arduino's Wire.h), I have made some progress:

I removed the '//' from the (3 each) commented out statements "//u8g->pin_list[U8G_PI_SET_A0] = 1;" and "// u8g_i2c_stop();" in file U8glib/utility/u8g_com_arduino_ssd_i2c.c :

$diff u8g_com_arduino_ssd_i2c.c.ori u8g_com_arduino_ssd_i2c.c
125c125
<       //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>       u8g->pin_list[U8G_PI_SET_A0] = 1;
130c130
<       // u8g_i2c_stop();
---
>       u8g_i2c_stop();
134c134
<       //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>       u8g->pin_list[U8G_PI_SET_A0] = 1;
146c146
<       // u8g_i2c_stop();
---
>       u8g_i2c_stop();
150c150
<       //u8g->pin_list[U8G_PI_SET_A0] = 1;
---
>       u8g->pin_list[U8G_PI_SET_A0] = 1;
163c163
<       // u8g_i2c_stop();
---
>       u8g_i2c_stop();

After recompiling Marlin4Due with this change the Arduino Due the conflict seems resolved and it can now access the I2C EEPROM (after having it activated in Configuration.h of course) while using the I2C OLED display - so far without any problem smiling smiley


I tried this with marlin 2.0 bugfix and ramps_fd_v2 (tinyoled uncommented), but display and eeprom are not working at the same time. Eeprom only is working. Display only is not working, but it is working for a second when i press disconnect and connect in pronterface. then it goes black again.

Does anyone have this working with Due?
Sorry, only registered users may post in this forum.

Click here to login