RPI-PICO-I2C-LCD lib slow work(Solved) #16219
Replies: 7 comments 14 replies
-
Please format your code as described here. |
Beta Was this translation helpful? Give feedback.
-
For test I put global variables inside a function and nothing change with slowly work,only wrong work :) But when i tried send result not to Lcd,as here lcd.move_to(col, row)
lcd.putstr(new_data[row][col]) I delete this two function and add 'print' for send results to Thommy, all working fast. These two function doesn't like a lot of empty functions, but why and how it fix ? |
Beta Was this translation helpful? Give feedback.
-
This is strange. Having many and unused functions does not affect the execution of a function. Maybe you can try using different I2C? on my board:
|
Beta Was this translation helpful? Give feedback.
-
And if put Lcd function first and empty function after calling lcd -all work good too |
Beta Was this translation helpful? Give feedback.
-
Is it possible that you are causing hash table collisions for function name lookups with very similar function names? I haven't looked at how MP does hashing. Try 60 randomly generated function names (use a python program to generate the functions, then paste them into this code). See if it runs fast then. |
Beta Was this translation helpful? Give feedback.
-
do you pre-compile your code, or is all the code in a single large file that
And thus fragmenting memory . In my experience i've been able to run large and complex applications in surprisingly little memory , once I learned how to avoid fragmenting it. |
Beta Was this translation helpful? Give feedback.
-
SOLVED! |
Beta Was this translation helpful? Give feedback.
-
Hello!
After adding another new function code started work slowly. I simulated this problem - I send a couple of words one by one to the 20x4 display, everything is fine, but if I add 60 empty functions that are not even called, the text starts to display very slowly.
Are there any solutions to add more function without slowing down the code?
Raspberry Pi Pico with RP2040
MicroPython v1.23.0
IDE:Thonny
Beta Was this translation helpful? Give feedback.
All reactions