Bug to-percent and ssd1306-oled-i2c

Hello. I am not at all selenium in English, I write through Google translit.
I make a program with a graph and a thermometer with an OLED 128X64 I2C SSD1306 screen wayland/ssd1306-oled-i2c@0.0.3 library
The program works, but as soon as I insert the xod/core/to-percent node on the screen, everything freezes and does not work.
Prog https ://yadi.sk/d/NJD1BaYdt4BMOA
Screen https ://yadi.sk/i/pN5tv3ymUjnkGw

The program is still incomplete and I have not done erasing the previous results of measuring the thermometer on the screen.

Всем привет. Я совсем не селен в английском, пишу через гугл транслит.
Делаю программу с графиком и термометром с экраном OLED 128X64 I2C SSD1306 библиотека wayland/ssd1306-oled-i2c@0.0.3
Программа работает, но как только вставляю нод xod/core/to-percent на экране все замирает и не работает.

Программа пока не закончена и я еще не сделал стирание предыдущих результатов измерения термометра на экране.

З.Ы. Есть ли возможность в XOD хотя бы вставить Quick Help на русском языке. Есть ли русское сообщество XOD и русский форум?

1 Like

Added erasing previous data from the screen.

Program https://yadi.sk/d/V_CnF3-SpiANtQ

temp2

tem1

Hello vitaliysh and welcome to the XOD community!

I’ve been trying to reproduce the problem you reported. As I don’t have a HDT22, I’ve created a simpler patch:

oled_to-percent.xodball (5.9 KB)

In the above patch xod/core/to-percent works fine with ssd1306-oled-i2c. Please could you share the patch in which you have used xod/core/to-percent? This would help with debugging.

1 Like

Thank you!

Program bug - to-percent
The bug is manifested using multiple nodes draw-text and draw-pixel

temp-bug.xodball (21.7 KB)

I think it’s not a problem of the library in particular, I have similar problems with several libraries, sometimes if I have a delay and add another change-pulse everything stops.

I can not find where the bug is, but I think it’s something in the pulses.

1 Like

The output pulse of clr-display is not using it, it is a very important pulse to synchronize, after a clear indicates that it follows. Connect to any before the buffer and test.

ps: you can also insert a defer on the bus T for example, so not all pulses T at the same time.

the DTH22 usually gives problems, do not leave it in a loop, send a pulse (defer)to read it can then be displayed on the screen, or at the exit of the text node, etc.

Alas. The first and second tips do not work.
Found is the problem with the format-number in the node.I put the format-number node right and everything was hanging and it was not working. (

ormat-number

Note that DHT22 is constantly reading (not always necessary), and on each pulse T, it write text + text + rectangle and pixel at the same time. That’s not good.

@vitaliysh could you answer for a few questions:

  1. What board do you use?
  2. What version of the XOD IDE?
  3. Check out __lib__ folder in your workspace, is there any xod directory? Is there a core directory inside? Try to rename it or delete (if you did not make any reasonable for you changes in this library) and reopen the IDE. If so, try again. Probably, you have an obsolete xod/core library with old format-number, which was not cross-platform.
  1. Clon Arduino Uno. I tried two different boards. The bug is the same.
  2. Version 0.28.2
  3. Removed and reinstalled the library “core” and the entire program itself, but the bug remains.

Hi, from what I see, you modifying a patch, that I uploaded, I get to that configuration after several tests.

If you include DHT22, you have to limit the readings, and send the pulse done (T) to value writing (text), then use the done (text) pulse until you achieve a sequence.

The defer in T, is being sent to several UDP at the same time, should put it where it receives the bus (1,2) and not where the bus emits.

The reading of the DHT22 is continuous, you can read every 0.1sec or send with a defer a pulse when you complete the entire OLED graphic cycle

:thinking:
I’ve just tried to reproduce the bug, but I didn’t.

But I haven’t got DHT21 right now and tried it with DHT11.
Catched the bug that DHT11 returns zeroes instead of real values on this patch (and it returns real values on another empty patch), but it caused by timings. DHT11 node should be improved with throttling node. And this is a known bug.

Probably, the problem in dealing with OLED. Try to replace Loop with a clock node with 1 second interval.

BTW, place watch nodes after format-number and your thermometer. Does their values stale too or it updates?

Alas. Did as you advised. The bug is not lost.

Thank you so much, but don’t tell me what font sizes are available in your library, 01h is very small
and 02h is very big.

Thanks for the feedback.

The SIZE input to the draw-text node is a magnification factor:
01h = 6x8 pixels
02h = 12x16 pixels
03h = 18x24 pixels
etc.

This is defined in the Adafruit GFX Arduino library (https://github.com/adafruit/Adafruit-GFX-Library), which is wrapped in my XOD library. Further font size options could be added by modifying the Adafruit GFX library.

2 Likes

Hi Wayland,

I am interested to try have an option to change the fonts and sizes for these OLED displays, I have opened the Adafruit GFX.h with notepad but have no idea what to change or add to try make this work.

If you could spare some time that would be greatly appreciated.

Regards,

Jason