Closed AdinAck closed 4 years ago
Hey @AdinAck
Sorry to hear you're experiencing this bug.
Could you provide the code you are using? If it's long you can put it at https://gist.github.com/
FYI, for something to appear in the plotter you cannot print it like
print(1)
# Prints "1"
You must use:
print((1, ))
# Prints "(1,)"
Awesome, that works! Maybe include that in the readme?
Good idea, will look into that. It is covered briefly in https://learn.adafruit.com/make-it-graph-plot/circuitpython-and-mu
The code below will read the Circuit Playground Express light sensor and send the output to the Serial port (also called the REPL) in a form called a Tuple. A tuple is just a group of fixed values gathered together, surrounded by parenthesis. For one value, a tuple would be shown as (tuplevalue, ), to two (tupleval1, tupleval2), etc. The comma in the first one makes sure it's a tuple and not a number in parenthesis like in math.
So now that I have it working I have noticed that it is very slow, updating maybe once every 7-15 seconds, is there a reason for this, can I somehow increase the update speed?
I can't reproduce that locally.
It may sound counter-intuitive but could you try add a delay somewhat like 0.05
seconds between, this might be better.
Unfortunately, I cannot try that in this case because my loop has to run as fast as possible for it is updating a screen. The value I am printing is the framerate. The Arduino serial plotter does it fast so I am interested as to why it is slow for me but not for you. The value being printed repeats a lot, could that be the issue? I'll pug in another board and run a test program to try and find the scenario required to recreate my issue.
Hmm, I'll give it some further testing tomorrow, but I don't know of any snags in the rendering that would cause huge delay.
Ok I ran the test and here is the result:
Here is the code:
import time
i = 0
while True:
print((i,))
i += 1
time.sleep(.05)
if i >= 100:
i = 0
This will only update the plotter once, right when it runs. I tried setting the delay time to .25 seconds, no change. When I completely removed the delay, the plotter started slow but then sped up very fast! but was erratic and clearly not updating as fast as the loop on the board.
Here is a video: link
The pull request I just submitted should fix this problem. I tested your example with it and it worked fine for me.
Fixed in 0.7.2
Works, Thank you!
I made my board print a number in a while True loop and I could see it in the serial monitor but not in the serial plotter.