Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4151

MicroPython • Re: Why is my MicroPython script running so slow with SD card?

$
0
0
I don't really understand what happened. When I first found a tutorial on working with SD cards in MicroPython, I saved another file for the testing code, which was just writing to a file and then reading from said file and outputting the contents. There was no lag in that file. I decided to copy and paste one by one different features of the program I was having lag issues with. To my surprise, the Pico did not lag as I first added the LCD object, then blackening the screen every frame, and then displaying the percentage of battery and the time, and eventually the battery bitmap indicator. I ended up adding every feature that was in the original script and there was no lag.

So the problem has been solved, however I am curious as to what the cause of the lag is, so tomorrow I'll look more closely at the two scripts to see what caused the lag. I don't want to abandon this issue, in case any other programmers stumble upon this thread. When I was searching for solutions before coming and posting here I couldn't find anything useful, so hopefully I can find out what was causing the problem and post it here to possibly spare others from hours of pulling their hair out.

Statistics: Posted by ChasTech — Sat Dec 28, 2024 9:00 pm



Viewing all articles
Browse latest Browse all 4151

Trending Articles