3705 views|4 replies

1w

Posts

25

Resources
The OP
 

Usage of data visualization in Thonny [Copy link]

 

First, in Thonny's view menu, check plotter.

Then in the program, print out the data you want to visualize, and Thonny will automatically determine the printed value and draw the plot. The printing method is

print(name, dat)

  • name is the name of the data, which can be any string, or you can leave name unset and just print dat.
  • dat is the data to be plotted, which can be an integer or a floating point number. You can print multiple values at a time, and each value will be displayed in a different color.
  • Be careful not to insert other print statements, as this will cause data plotting errors and failure.

Taking the pyboard's accelerometer as an example, run the following program:

import pyb

acc = pyb.Accel()
while 1:
    print('x', acc.x(), 'y', acc.y(), 'z', acc.z())
    pyb.delay(500)

Operation Results

Latest reply

When I use thonny, I often encounter the situation that pyb suddenly stops responding during the download process. After reinserting it, it can be used again. What's going on?   Details Published on 2021-2-27 15:09
 
 

1w

Posts

25

Resources
2
 

When plotting data, the value range is automatically detected and appropriate processing is performed to make the display clearer.

 
 
 

128

Posts

0

Resources
3
 

Getting taller and taller

 
 
 

41

Posts

0

Resources
4
 

When I use thonny, I often encounter the situation that pyb suddenly stops responding during the download process. After reinserting it, it can be used again. What's going on?

 
 
 

1w

Posts

25

Resources
5
 
joeymm posted on 2021-2-27 15:09 When I use thonny, I often encounter that pyb suddenly stops responding during the download process. After reinserting it, it can be used again. What's going on? ...

I haven't encountered this problem yet. Try a newer version.

 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list