U8g vs. U8g2 Arduino Graphics Libraries (Tutorial - OLED and LCD screens with Arduino UNO)

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 104

  • @upir_upir
    @upir_upir  9 місяців тому +3

    Do you like the video? Please consider buying me a coffee ☕, thank you! www.buymeacoffee.com/upir

  • @DanielMelendrezPhD
    @DanielMelendrezPhD Рік тому +7

    Fantastic work. Your video dropped heaven-sent since I am working on a small project based on your rotating cube video and it reinforced some concepts on the u8g2 library. Thanks

    • @upir_upir
      @upir_upir  Рік тому +1

      Perfect, that’s great that the timing worked out nicely. Good luck with your project and please feel free to share your creations, I would love to see it.

  • @ucglib530
    @ucglib530 Рік тому +7

    Amazing Video. Great description of the page mode. Small remark: LCDs are slower because of the SW I2C mode used in the video. HW I2C mode is much faster and is also possible with the LCDs.

    • @upir_upir
      @upir_upir  Рік тому +1

      Thank you for your nice comment and clarifying the slowness. I didn´t think that SW vs HW I2C would make such a difference, but I will surely try it with HW I2C to see the full potential. One question - do you know why you have to specifically set the I2C address for those particular LCDs, and not for other? Thank you!

    • @ucglib530
      @ucglib530 Рік тому +3

      @@upir_upir U8g2 defaults to the lowest I2C address allowed by display controller. Usually multiple I2C are possible with the display controller. Often the I2C address can be configured on the display PCB. Nevertheless the display manufacturer sometimes decides to use a different I2C address as a default configuration. In this case you either need to resolder a solder bridge on the PCB or provide the correct I2C address to U8g2.

    • @upir_upir
      @upir_upir  Рік тому +3

      @@ucglib530 Thank you for the clarification; it all makes perfect sense once you know it. One last question, am I talking to the almighty Oli Kraus?

    • @ucglib530
      @ucglib530 Рік тому +4

      @@upir_upir ah, well yes, I had been too lazy to rename my youtube account 🤪

    • @upir_upir
      @upir_upir  Рік тому +3

      @@ucglib530 ok, please to meet you! Most of my projects wouldn’t be possible without your amazing library.

  • @SuddenlyPineapple
    @SuddenlyPineapple Рік тому +5

    Thanks man, I've been doing almost every step which you showed in this video manually since I've saw your first video with Turbo Gauge. This is verry nice tutorial for automating this conversions. Also it's worth to mention, that u8g2 lib works for almost every 128x64 screen and solves problems with sudden freeze on cheaper one models, thats probably why you've done this tutorial as I can guess ;) Verry nice work, can't wait when you connect it to MCP2515 and show some real data on this littile cuties 😎🤞

    • @upir_upir
      @upir_upir  Рік тому +1

      Thank you for your nice comment, Wojciech! I´m gald it was helpful, and to answer your question, yes, I would like to show some real data soon :) Good luck with your project. Is there something you can share with the world?

  • @thisnthat3530
    @thisnthat3530 11 місяців тому +2

    If you hold the shift key while right-clicking in the file window (blank area of it) there is an additional item in the context menu, either "Open Command Prompt Here" or "Open Powershell window here" depending on version of Windows and/or a specific setting. Either way you get a command prompt already pointing to the correct folder.

    • @upir_upir
      @upir_upir  11 місяців тому

      Thank you for letting me know, it´s definitely great to know and I´m sure other viewers would appreciate this information.

  • @andymouse
    @andymouse Рік тому +2

    You vdeos quite frankly continue to grow in 'Awesomeness'....cheers!

    • @upir_upir
      @upir_upir  Рік тому

      Thank you kindly for your nice comment(s). I´m glad you are enjoying my videos. If you have any ideas for future topics, I´m all ears!

  • @atheist_happie
    @atheist_happie 9 місяців тому +3

    Pro tip if you're using the u8g2 library make sure to ✔️ "swap" and convert image no more flipped parts of pictures

    • @upir_upir
      @upir_upir  9 місяців тому +1

      Yep, this video was recorded before this option was there…

    • @atheist_happie
      @atheist_happie 9 місяців тому

      @@upir_upir ohh i see... i tried this today and it's worked for me 😍
      I'll surely make my potentiometer pimp like you did thank you 🙂

    • @TheScissorunner
      @TheScissorunner 2 місяці тому

      Great Pro Tip!! To add a bit more context. Go to image2ccp - 4. Output - Swap bits in byte: - swap
      Copy hex code to Arduino and it works!

  • @nyfaz
    @nyfaz Рік тому +3

    Thank you again for sharing your informations :)
    Greetings from Germany.

    • @upir_upir
      @upir_upir  Рік тому

      Danke schön! I´m glad you like it, and good luck with your projects! Greeting from not-so-far-away-from-germany.

  • @upir_upir
    @upir_upir  Рік тому +3

    The previous video 𝐀𝐫𝐝𝐮𝐢𝐧𝐨 𝐎𝐋𝐄𝐃 𝐌𝐞𝐧𝐮 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥 is here - ua-cam.com/video/HVHVkKt-ldc/v-deo.html

  • @tulnaf
    @tulnaf 2 місяці тому

    10x!! great video! very comprehensive and smooth. thank you!

    • @upir_upir
      @upir_upir  2 місяці тому

      Thank you, I´m glad it was helpful!

  • @colinsmith6340
    @colinsmith6340 Рік тому +1

    u8g is a fantastic lib. I used to use it with the generic 128x64 graphic LCDs that are all over ebay before i moved across to touch screen TFTs.

    • @upir_upir
      @upir_upir  Рік тому

      I fully agree. It´s well designed library and I enjoy using it. Out of curiosity, which touch screen TFTs are you using?

  • @tfninjadoom
    @tfninjadoom Рік тому +2

    incredible video, thank you so much

    • @upir_upir
      @upir_upir  Рік тому

      You are welcome, thank you for your comment!

  • @alfayudhistira7922
    @alfayudhistira7922 8 днів тому +1

    Asking about the current_screen = 1 ... I already build the menu trying to replicate this video, it's great, i'm just wondering if it's possible to replace those screenshots with a live screen that include variables for each menu?

    • @upir_upir
      @upir_upir  8 днів тому

      Thank you. Yes, that should be possible, just add your own code instead of showing the screenshot.

  • @Cichlor
    @Cichlor Рік тому +2

    Great Work - Again Thank you!

  • @gtxsatria2010
    @gtxsatria2010 Рік тому +2

    tkank Mr was make video again

    • @upir_upir
      @upir_upir  Рік тому +1

      Thank you, I’m glad you like it!

    • @gtxsatria2010
      @gtxsatria2010 Рік тому

      @@upir_upir tentu saja , saya sangat senang dengan video yang anda buat. biarpun saya pemula dan memang rumit saya memahaminya tapi biarkan waktu yang menjawab. kalau boleh buat video tentang
      1. menu screen "detektor magnet induksi"
      2. select buttong sub menu 1 "frequency value"
      3. select button again sub menu 2 " Sens Value"
      4. selectbuttons again sub menu 3 "Wavelength"
      5. select button again sub menu 4 " Filter Divider"

  • @eisbarfan7716
    @eisbarfan7716 Рік тому +2

    Great video, thanks

    • @upir_upir
      @upir_upir  Рік тому

      You are welcome. Glad you liked it!

  • @ACID2BREAKS
    @ACID2BREAKS Рік тому +3

    I am a bit lost, may be you can help me? I tried to adapt procedure for getting the arduino code with image2cpp. The OLED only shows crazy stuff as you have showed at 5:34, is there a way to avoid such mess up upfront?

    • @upir_upir
      @upir_upir  Рік тому +1

      For U8G2 library, you cannot generate images using image2cpp, since it does not suport the XBM format (yet). You need to use other tools, like the mentioned LCD Image converter or Image Magick. Hope it makes sense. I also hope that someone will update image2cpp to support XBM format.

    • @ACID2BREAKS
      @ACID2BREAKS Рік тому +1

      @@upir_upir thank you for your fast reply :). I did found (through the deeps of arduino forum and the internet) a way around as you described. Create a .jpg file of Photopea load it into gimp and export it as GLIP Pixmap and paste the code into sketch.

    • @upir_upir
      @upir_upir  Рік тому +1

      It’s also described in the video 😳

    • @ACID2BREAKS
      @ACID2BREAKS Рік тому +1

      @@upir_upir oh damn it. Too much coding to less hearing 😂🙈

    • @upir_upir
      @upir_upir  Рік тому

      No worries, I’m glad you have sorted it out 🙂

  • @jeremiaspenas1802
    @jeremiaspenas1802 Рік тому +1

    Hi! great videos, they are really cool. I would like to use the circular gauge that you use for mph and rpm. I saw in one of your earlier videos that it can be animated, showing the progress, but did not find code for that. Do you have it, or any resource i can check in how to do that? Thanks!

    • @upir_upir
      @upir_upir  Рік тому

      Thank you, I’m glad you like it! Sure, please send me an e-mail and I will send you the source code.

  • @gerarldlee
    @gerarldlee 4 місяці тому +1

    Hey man, is it possible to increase the pixels, and use the RM67162 controller like the lilygo-s3-amoled screen? Thkx

    • @upir_upir
      @upir_upir  4 місяці тому +1

      Sure, that should be possible, but it will definitely take some time. That said, I do have that lilygo board and I would like to do some project with it.

  • @GANCFLEX
    @GANCFLEX Рік тому +2

    for bitmaps you can use flash as well

    • @upir_upir
      @upir_upir  Рік тому

      What do you mean by that? I´m sorry but I don´t fully undestand.

    • @GANCFLEX
      @GANCFLEX Рік тому

      @@upir_upir forget it, i wrote a bullshit

    • @upir_upir
      @upir_upir  Рік тому

      No problem, happens to everyone sometime 🙂

    • @GANCFLEX
      @GANCFLEX Рік тому +1

      @@upir_upir gotta one question, are you form czech republic?

    • @upir_upir
      @upir_upir  Рік тому

      Yes, I am. Are you as well?

  • @gleteam2330
    @gleteam2330 Рік тому +2

    Can I buy a screen ready to work I’m not familiar with coding

    • @upir_upir
      @upir_upir  Рік тому +1

      What are you trying to achieve? You don´t need to know how to code if you know how to copy and paste code :) (yes, that´s my approach)

  • @ThalysCosta
    @ThalysCosta Рік тому +1

    Hello, I have a question, were you able to connect an ODB2 adapter via bluetooth to get this information from the ECU? If you can give me some tips, thanks!

    • @upir_upir
      @upir_upir  Рік тому +1

      I haven´t tried that yet, but it´s on my to-do list. Hopefully soon!

    • @ThalysCosta
      @ThalysCosta Рік тому +1

      @@upir_upir Cool! I'm trying to do it but it's not working

    • @upir_upir
      @upir_upir  Рік тому

      @@ThalysCosta What about perhaps starting with some dedicated OBD2 Arduino compatible board first?

  • @Lemonholster
    @Lemonholster Рік тому +1

    How do you avoid screen flickering? I always have the problem with the delay/refresh in the loop for the input.

    • @upir_upir
      @upir_upir  Рік тому

      Could you be more specific? What flickering? The flickering that might be visible on the video is only due to camera synchronization, and it’s not visible in real life.

  • @nkronert
    @nkronert Рік тому +1

    What a bummer that they changed the bit order as well as made the image interpretation inverted. Are there no flags to tell the library to be backwards compatible?

    • @upir_upir
      @upir_upir  Рік тому

      I don´t think there are any flags, but at least the image2cpp now has an option to export image to u8g2 library with just one checkbox.

    • @nkronert
      @nkronert Рік тому

      @@upir_upir I just checked the library sources. To me it looks like a backward compatibility could be easily introduced in the function u8g2_DrawHXBM in u8g2_bitmap.c, but this is obviously something to discuss with the library's author.

  • @haideralikhan5947
    @haideralikhan5947 9 місяців тому +1

    @upir any chance you know why sometimes the display stops refreshing while using the old u8g library but there is no issue with the new u8g2 library?

    • @upir_upir
      @upir_upir  9 місяців тому

      Can you check the initialization routines of those libraries if those are the same? Or a better question, is there a reason to stick with the U8g instead of the newer u8g2?

    • @haideralikhan5947
      @haideralikhan5947 9 місяців тому +1

      @@upir_upir no reason to stick with the old library, I just want to find the reason it doesn't work to be a better engineer. It's not in the initialisation routine. It's a hit or miss, some displays work fine others don't depending on the manufacturer

    • @upir_upir
      @upir_upir  9 місяців тому +1

      @haideralikhan5947 are you 100% sure it’s SSD1306? Sometimes the sellers lists those but in fact it’s a different chip - like the SSD1309 or Sh1106. If it’s IIC version, try putting pull-up resistors for data and clock, some modules have those and some don’t. The safest option is to of course buy modules from known brands like Adafruit or Pimoroni, but obviously they are more expensive. Hope this was at least a little bit helpful.

    • @haideralikhan5947
      @haideralikhan5947 9 місяців тому +1

      @@upir_upir absolutely right, I have put 2 pull-up resistor and the screen doesn't freeze anymore. Cannot I never thought about that.
      - option 1: keep using the old library which consumes less memory and is also a bit faster. Add 2 more resistors increasing cost.
      -option 2: use the new library that has loads of new features, doesn't need pull up resistors it's just a bit slower.
      I am definitely going to choose the second option. Thanks a lot for the help, the pull-up resistor were a really nice shout

    • @upir_upir
      @upir_upir  9 місяців тому

      @haideralikhan5947 cool, I’m glad it was helpful. I still don’t quite understand why the newer version of the library works and the older one don’t. Perhaps they default to different speed?

  • @matthewStapleton
    @matthewStapleton 10 місяців тому +1

    Great video

    • @upir_upir
      @upir_upir  10 місяців тому

      Thank you! I´m glad you like it.

  • @lvyathan
    @lvyathan 2 місяці тому +1

    im confused at the moment, i dont know why but the u8g2 library is much slower compared to the u8g library... i don't know what im doing wrong but it would be nice to know if anyone else is having the same issue

    • @upir_upir
      @upir_upir  2 місяці тому +1

      Do you use the same rendering method? I.e. page vs. bigger page vs fullscreen? U8G only has page mode. If you have enough memory, fullscreen drawing is faster. Also, I have noticed that if you don´t set images to transparent, it slows down drawing. I would try that as well.

    • @lvyathan
      @lvyathan 2 місяці тому

      @@upir_upir I figured why this was the case, after surfing the internet for quite a little bit I found similar cases with mine, it was that some SSD1306 modules from china might not come with a ACK. so its does not work with HW I2C, rather only with SW. (which is the one I own)
      Simply, it takes around 600ms to draw a single frame on screen, which is super super slow.
      The FAST I2C U8G library works REALLY well with even this display, so im quite surprised how different it was with U8G2, but this makes more sense now after doing some digging!
      Thanks for the response though, I Really appreciate it! :)

  • @76Raby
    @76Raby Рік тому +1

    Která z knihoven zabere méně paměti (ponechám-li program jinak stejný).
    Which library is les memory hungry assuming the same program

    • @upir_upir
      @upir_upir  Рік тому +1

      With this particular sketch, the memory usage is as follows, so the older library is slightly smaller.
      U8G (older):
      Sketch uses 27662 bytes (85%) of program storage space. Maximum is 32256 bytes.
      Global variables use 463 bytes (22%) of dynamic memory, leaving 1585 bytes for local variables. Maximum is 2048 bytes.
      U8G2 (newer):
      Sketch uses 31318 bytes (97%) of program storage space. Maximum is 32256 bytes.
      Global variables use 869 bytes (42%) of dynamic memory, leaving 1179 bytes for local variables. Maximum is 2048 bytes.

  • @nickname0ff
    @nickname0ff Рік тому +1

    Great!

  • @ohseiyagaming2503
    @ohseiyagaming2503 Рік тому +1

    Sir, good day. Can you make sample ui for M5stack Core2? Thanks. More power.

    • @upir_upir
      @upir_upir  Рік тому

      I can certainly take a look, it looks like an interesting device!

  • @nsonelectronicslabs9776
    @nsonelectronicslabs9776 10 місяців тому +2

    please do this code using esp32 and graphics lcd i2c

    • @upir_upir
      @upir_upir  10 місяців тому +1

      Yes, I do plan to record videos using ESP32, stay tuned..

    • @nsonelectronicslabs9776
      @nsonelectronicslabs9776 10 місяців тому

      @@upir_upir then how do i draw bitmap on the bigger lcd please ?

  • @akshaypalkar7097
    @akshaypalkar7097 Рік тому +1

    is this library compatible with esp8266?

    • @upir_upir
      @upir_upir  Рік тому +1

      Yes for the u8g2. Not for the older one (u8g).

    • @akshaypalkar7097
      @akshaypalkar7097 Рік тому +1

      @@upir_upir tried and working

    • @upir_upir
      @upir_upir  Рік тому +1

      Good to know! Thank you for the update

  • @akangrangkas4334
    @akangrangkas4334 Рік тому +1

    I need tutorial, grafik bandwidth WiFi, arduino?

    • @upir_upir
      @upir_upir  Рік тому

      Could you please be more specific? I´m not 100% sure I understand what you are looking for..

    • @akangrangkas4334
      @akangrangkas4334 Рік тому

      sorry if the comments above are not clear, I'm from Indonesia. I've been looking for a sharing tutorial on how to display internet bandwidth graphics on the display using Arduino Uno but it's not there, can you make the tutorial 🙏🙏

  • @Abc-sl1nf
    @Abc-sl1nf Рік тому +1

    That's too much work. Nextion?

    • @upir_upir
      @upir_upir  Рік тому

      Yes, Nextion is always an option if you don´t like coding.

  • @NeilDelaRoca
    @NeilDelaRoca 11 місяців тому +1

    I need further assistance, especially on increasing the refresh frame rate, it is kinda slow if i used the GraphicsTest.ino .
    i used the display which is same as yours on 0:10 .
    i used the U8G2_ST7567_ENH_DG128064I_F_SW_I2C u8g2(U8G2_R2, SCL, SDA, /* reset=*/U8X8_PIN_NONE); constructor

    • @upir_upir
      @upir_upir  11 місяців тому

      Try using the HW I2C constructor, that should help.

  • @MASSKA
    @MASSKA Рік тому +1

    where to buy these displays

    • @upir_upir
      @upir_upir  Рік тому

      All the links are in the description of the video.