Git Product home page Git Product logo

u8glib_arduino's Introduction

U8glib

A graphics library with support for many different monochrome displays.

nhd_oled180.jpg dogs102_180.jpg

Left: NHD-2.7-12864 OLED (SSD1325), right: EA DOGS102 LCD (UC1701)

u8glib_arduino's People

Contributors

olikraus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

u8glib_arduino's Issues

Anet A8 BigTreeTech Issue

I am trying to get the BigTreeTech mini12864 working on the Anet A8. No matter what I try the same error pops up.
it says U8glib-HAL.h does not exsist
I'm using the Marlin Firmware 2.0.9.3

ST7735

It is worth waiting for the support of the display ST7735?
Is it possible to correct an existing library to support this display?

Added support for T6963 boards with 160x80 display

Hi,
I made a few updates to U8glib_Arduino to add support for 160x80 T6963 boards. Tested and working on Uno R3 with an old display salvaged from a discarded POS terminal....
github.com/jaloadsman/U8glib_Arduino/tree/includeT6963_160x80
Cheers,
John

EA DOGL128-6

Hello,
I wanted to ask, if this library does work with an EA DOGL128-6 and if yes, what setup I have to choose, for example:
//U8GLIB_DOGM128 u8g(13, 11, 10, 9);

Thank you very much!

"The filename or extension is too long" compile error

U8glib v1.19.1 has been compiling fine for me with Marlin while it's globally referenced through Sketch>Import Library in the Arduino IDE. However, if you try to reference it through a local directory you'll get the following error:

fork/exec C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc.exe: The filename or extension is too long. Error compiling for board Arduino/Genuino Mega or Mega 2560.

I've also tried versions 1.17, 1.18 and 1.18.1 with the same result. Another person on the reprap forums seems to be having the same thing happen: http://forums.reprap.org/read.php?415,690652
It seems to be something specific to windows, but I'm not sure what the problem is past that.

U8glib_Arduino fails to compile

Trying to compile Marlin firmware on Arduino 1.6.8, everything compiles well, but when it arrives to U8glib, this is what I got, indifferent of the directory the library is installed to: filenam or extencion too long.

Using library U8glib at version 1.19.1 in folder: C:\Program Files (x86)\Arduino\libraries\U8glib 
fork/exec C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc.exe: The filename or extension is too long.
Error compiling for board Arduino/Genuino Mega or Mega 2560.

question re: delay instructions

Hey there!

I'm using U8g2 on an ATmega328P and it's working great. I have a question re: the delay messages I'm accepting from U8g2. I first laid out my GPIO/delay callback with the following cases:

    case U8X8_MSG_DELAY_NANO:
      _delay_us(0.001 * arg_int);
      break;

    case U8X8_MSG_DELAY_100NANO:
      _delay_us(0.1 * arg_int);
      break;

    case U8X8_MSG_DELAY_10MICRO:
      _delay_us(10 * arg_int);
      break;

    case U8X8_MSG_DELAY_MILLI:
      _delay_ms(arg_int);
      break;

I noticed that e.g. doing a sendBuffer with full framebuffer worked fine, but updated slowly. For some reason I decided to try this:

    case U8X8_MSG_DELAY_NANO:
      //_delay_us(0.001 * arg_int);
      break;

    case U8X8_MSG_DELAY_100NANO:
      //_delay_us(0.1 * arg_int);
      break;

    case U8X8_MSG_DELAY_10MICRO:
      //_delay_us(10 * arg_int);
      break;

    case U8X8_MSG_DELAY_MILLI:
      //_delay_ms(arg_int);
      break;

And it still works, but faster!

Do you have any idea why? One suggestion that has been made to me is that, because I'm running on the internal clock @8MHz, it's not running fast enough that the "extra" delays are needed. I plan to get the AVR running from an external clock @16mhz soon, and maybe that'll break without the delays.

Thanks for your time!

U8glib

Wie kan mij helpen , ik heb een display SBC-LCD 128X64 willen opstarten maar ik krijg altijd dezelfde foutmelding terug wat doe ik verkeerd , ik heb U8glib gebruikt , of moet ik U8g2 gebruiken . graag een antwoord aub .
Pieter204

Arduino 101 can use u8g library?

Hi,i want my oled drive by arduino 101,compilation is successful,connect is ok,but OLED doesn't work,i don't know why,please help me find the problem,thanks.
my code:
`

include "U8glib.h"

define REST 4

define DC 5

U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE);

void draw(void) {
// graphic commands to redraw the complete screen should be placed here

u8g.setFont(u8g_font_unifont);
//u8g.setFont(u8g_font_osb21);
u8g.drawStr( 20, 36, "OPENJUMPER");
}

void setup(void) {
pinMode(REST,OUTPUT);
pinMode(DC,OUTPUT);
digitalWrite(REST,HIGH);
digitalWrite(DC,LOW);

// flip screen, if required
// u8g.setRot180();

// set SPI backup if required
//u8g.setHardwareBackup(u8g_backup_avr_spi);

// assign default color value
if ( u8g.getMode() == U8G_MODE_R3G3B2 ) {
u8g.setColorIndex(255); // white
}
else if ( u8g.getMode() == U8G_MODE_GRAY2BIT ) {
u8g.setColorIndex(3); // max intensity
}
else if ( u8g.getMode() == U8G_MODE_BW ) {
u8g.setColorIndex(1); // pixel on
}
else if ( u8g.getMode() == U8G_MODE_HICOLOR ) {
u8g.setHiColorByRGB(255,255,255);
}
}

void loop(void) {
// picture loop
u8g.firstPage();

do {
draw();
} while( u8g.nextPage() );

// rebuild the picture after some delay
delay(500);
}`

Error variable 'colors' with dynamic initialization put into program memory area

On the example U8GLib.ino is not possible to compile.
Error on line 142: const colorDef<uint8_t> colors[] MEMMODE={

full error of compiler is:

src/menuIO/U8GLibOut.h: In function 'global constructors keyed to 65535_0_U8GLib.ino.cpp.o':
U8GLib:142:25: error: variable 'colors' with dynamic initialization put into program memory area
const colorDef<uint8_t> colors[] MEMMODE={
^
lto-wrapper.exe: fatal error: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc returned 1 exit status
compilation terminated.
c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
variable 'colors' with dynamic initialization put into program memory area

Arduino version 1.8.13
Any idea?

ESP32 U8GLIB_SH1106_128X64 Unhandled Exception please help!

Hi, I am working on a school project with an ESP32, I managed to get my OLED:
https://ibb.co/yyRmHMz
To work well using U8GLIB_SH1106_128X64 u8g(13, 12, 5, 9, 11); on an Arduino Uno, however it will not run on an ESP32, here is the error:

Raw error:

configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:8896
load:0x40080400,len:5816
entry 0x400806ac
Guru Meditation Error: Core  0 panic'ed (LoadStoreError). Exception was unhandled.
Core 0 register dump:
PC      : 0x400d69a0  PS      : 0x00060130  A0      : 0x800d6a85  A1      : 0x3ffe3aa0  
A2      : 0x3ffc10c4  A3      : 0x3ffbec84  A4      : 0x40144ad6  A5      : 0x3ff000cc  
A6      : 0x000000ff  A7      : 0x00000000  A8      : 0x00000000  A9      : 0x3ffe3a80  
A10     : 0x00000001  A11     : 0x00000001  A12     : 0x00000002  A13     : 0x00000000  
A14     : 0x00000016  A15     : 0x00000000  SAR     : 0x0000001d  EXCCAUSE: 0x00000003  
EXCVADDR: 0x40144ad6  LBEG    : 0x400d6d6c  LEND    : 0x400d6d71  LCOUNT  : 0x00000000  

Backtrace: 0x400d69a0:0x3ffe3aa0 0x400d6a82:0x3ffe3ac0 0x40143806:0x3ffe3ae0 0x400d6dab:0x3ffe3b00 0x400d6ec1:0x3ffe3b20 0x400d6f05:0x3ffe3b40 0x400d6912:0x3ffe3b70 0x400d3c02:0x3ffe3ba0 0x400dba47:0x3ffe3bd0 0x4008225d:0x3ffe3bf0 0x4008246c:0x3ffe3c20 0x40079053:0x3ffe3c40 0x400790b9:0x3ffe3c70 0x400790c4:0x3ffe3ca0 0x4007928d:0x3ffe3cc0 0x400806de:0x3ffe3df0 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20


Decoded:

PC: 0x400d69a0: u8g_GetGlyph at C:\Users\liamd\Documents\Arduino\libraries\U8glib_Arduino-master\src\clib\u8g_font.c line 391
EXCVADDR: 0x40144ad6

Decoding stack results
0x400d69a0: u8g_GetGlyph at C:\Users\liamd\Documents\Arduino\libraries\U8glib_Arduino-master\src\clib\u8g_font.c line 391
0x400d6a82: u8g_draw_glyph at C:\Users\liamd\Documents\Arduino\libraries\U8glib_Arduino-master\src\clib\u8g_font.c line 203
0x400d6dab: u8g_pb8v1_Set8PixelOpt2 at C:\Users\liamd\Documents\Arduino\libraries\U8glib_Arduino-master\src\clib\u8g_pb8v1.c line 127
0x400d6ec1: __analogSetWidth at C:\Users\liamd\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\esp32-hal-adc.c line 43
0x400d6f05: __analogSetCycles at C:\Users\liamd\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32\esp32-hal-adc.c line 51
0x400d6912: u8g_font_GetEncoding97Pos at C:\Users\liamd\Documents\Arduino\libraries\U8glib_Arduino-master\src\clib\u8g_font.c line 160
0x400d3c02: _GLOBAL__sub_I__ZN11WiFiAPClass6softAPEPKcS1_iii() at C:\Users\liamd\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/IPAddress.h line 94
0x400dba47: esp_vApplicationIdleHook at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/freertos_hooks.c line 48
0x4008225d: start_cpu0_default at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c line 367
0x4008246c: call_start_cpu0 at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp32/cpu_start.c line 238

I adjusted the pin outs in the U8GLIB_SH1106_128X64 u8g(x, x, x, x, x); code to ensure it works with ESP32 pin out. I also tried uploading code to the ESP32 with nothing except the line just mentioned, and it still generated the error.

Thanks in advanced for your help, I really want to use your library because Adafruit is to difficult for me to understand.
I appreciate your help!

U8glib.h: No such file or directory

Hello, I'm using Arduino IDE and I'm uploading to a MKS 1.4 board (Arduino Mega basically) and the IDE is saying U8glib.h: No such file or directory. I'm not sure what I'm doing wrong, could someone help?

Chess example notation

Hi, I really enjoyed your chess on my little OLED display :)) Great work!!!
You just may want to rearrange the code In chessengine.c for cu_add_pos() to make it display moves correctly:
*s = pos;
*s &= 15;
*s += 'a';
s++;
*s = pos;
*s >>= 4;
*s += '1';

slow performance in full buffer mode

hi,

either I don't understand the performace gain with full buffer mode or there is something wrong.

the Hello World exampe takes 583ms from clearBuffer to sendBuffer.

I am using this constructor:
U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=/ SCL, / data=/ SDA, / reset=*/ U8X8_PIN_NONE);

I was hoping that I can use this to perform partial updates to the screen to increase performance. I.e. render a full screen and after that only update a small portion of the screen ( a rapidly changing progress bar). The old u8glib refreshed the entire screen in "just" 320 milliseconds (with HW fast I2C).

SAMD: delay.h: No such file or directory

Following happens when build for M0 or Zero boards both in Arduino SDK and platform-io.

C:\Users\***\Documents\Arduino\libraries\U8glib\src\clib\u8g_delay.c:57:14: fatal error: delay.h: No such file or directory
#    include <delay.h>
              ^~~~~~~~~
compilation terminated.

It helps to comment the include out:

/* issue 353 */
//#if defined(ARDUINO_ARCH_SAMD)
//#    include <delay.h>
//#endif

Could you fix it yourself or should I go a full circle with cloning and issuing pull request?

SSD1306 Contrast Fix, same as 1309

Greetings,

I added this to u8g_dev_ssd1306_128x64.c per your fix for the 1309 and u8g.setContrast() works now :

tested with these 2 inits:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0|U8G_I2C_OPT_NO_ACK|U8G_I2C_OPT_FAST);
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

case U8G_DEV_MSG_CONTRAST:
u8g_SetChipSelect(u8g, dev, 1);
u8g_SetAddress(u8g, dev, 0); /* instruction mode /
u8g_WriteByte(u8g, dev, 0x081);
u8g_WriteByte(u8g, dev, (
(uint8_t )arg) ); / 11 Jul 2015: fixed contrast calculation */
u8g_SetChipSelect(u8g, dev, 0);
return 1;

Thanks!

Persian

Hello Dear Oliver
thanks for your library
I wanna use persian font. how can i do that?
u8g.setFont(u8g_font_6x10);
u8g.drawStr(62,10,"سلام");

can i print سلام directly?

Support for I2C on Teensy 3.1

I have a seeedstudio 128x64 OLED display that works with Adafruit's and seeedstudio's own library with Teensy 3.1
U8glib compiles for this combination, but I cannot get the display to show anything.
I used this initialization line:
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NONE|U8G_I2C_OPT_DEV_0);
I used the same wiring as with the other libraries (Hardware I2C pins)

Did anyone get this combination of devices to run? I would appreciate to get this very versatile library to work with my combination.

PS: I found the following dead thread in the pjrc forums (creator of the Teensy)
https://forum.pjrc.com/threads/23540-Using-u8glib-w-seeedstudio-I2c-oled-display-on-Teensy-3

bdf2u8g_101 help please to use

Hello olikraus,
I am sorry if I duplicate an issue, i did not find a solution to my problem.
It is: I want to make my font, I finally found out how to make bdf file and now I am trying to use bdf2u8g_101.exe to make a file for u8g library. Is it a right way to do? I am trying to execute this exe but it loads and immediately terminates. I have seen that there is in u8g2 library should be a new tool for this but there is no exe. Now I have 2 issues how to load an exe or how to use source files in font tools folder? How should I compile it? I am really sorry for being such a dumb. I need a help on converting bdf into u8g format to make it available for my screen.

HW SPI for st7920 for Arduino Due

Why disabled Hardware SPI for st7920 on Arduino Due ?
u8g.h:

# elif defined(**SAM3X8E**)   /\* Arduino Due */
# define U8G_COM_HW_SPI u8g_com_arduino_hw_spi_fn
# define U8G_COM_ST7920_HW_SPI u8g_com_null_fn
# endif

This hardware work fine in both hardware and software SPI mode for u8g2 lib !

P.S.
Need for support ReprapWorld Graphical LCD screen v1.0 on Ultratronics Pro v1.0 (Arduino Due based) in Marlin MK4Duo Firmware

AVR GCC fails to compile the library

When trying to build the project using this lib with arduino-makefile I got this:

/usr/share/arduino/hardware/tools/avr/bin/avr-g++ -MMD -c -mmcu=atmega32u4 -DF_CPU=16000000L -DARDUINO=105  -D__PROG_TYPES_COMPAT__ -I/usr/share/arduino/hardware/arduino//cores/arduino -I/home/zezic/Work/Toolchanger/toolchanger/Arduino_Boards/sparkfun/avr/variants/promicro    -I/home/zezic/Work/Toolchanger/toolchanger/libs-arduino/SPI/src    -I/home/zezic/Work/Toolchanger/toolchanger/libs-arduino/Wire/src    -I/home/zezic/Work/Toolchanger/toolchanger/libs/U8glib_Arduino/src -Wall -ffunction-sections -fdata-sections -Os -DUSB_VID=0x1b4f -DUSB_PID=0x9206 -fpermissive -fno-exceptions -std=gnu++11 -fno-threadsafe-statics -flto main.cpp -o build-promicro-16MHzatmega32U4/main.cpp.o
In file included from /home/zezic/Work/Toolchanger/toolchanger/libs/U8glib_Arduino/src/U8glib.h:42:0,
                 from main.cpp:4:
/home/zezic/Work/Toolchanger/toolchanger/libs/U8glib_Arduino/src/clib/u8g.h:123:25: internal compiler error: in type_hash_canon, at tree.c:6953
 typedef uint8_t PROGMEM u8g_pgm_uint8_t;
                         ^

/home/zezic/Work/Toolchanger/toolchanger/libs/U8glib_Arduino/src/clib/u8g.h:123:25: internal compiler error: Segmentation fault
avr-g++: internal compiler error: Segmentation fault (program cc1plus)

It compiles if I do the next change, but I've not checked the functionality yet:

-typedef uint8_t PROGMEM u8g_pgm_uint8_t;
+typedef uint8_t u8g_pgm_uint8_t;

Cyrillic fonts for your library

Dear sir,
I appreciate the library you created. I would like to add some new cyrillic fonts to your library. How can i send you a file with the font data?

Tag 1.18.1 contains bad version file

Hello Oliver,
You should retag release 1.18.1 as it contains the bad version of library.properties and Arduino IDE doesn't download the right zip.
My last upgrade keeps me still in version 1.18.
Regards,
Flav

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.