arduino:sds011
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| arduino:sds011 [2020/01/04 18:05] – aistis | arduino:sds011 [2020/01/06 08:23] (current) – aistis | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| https:// | https:// | ||
| + | {{: | ||
| + | |||
| + | <code python> | ||
| + | import serial | ||
| + | import matplotlib.pyplot as plt | ||
| + | |||
| + | s = serial.Serial(port=' | ||
| + | plt.figure() | ||
| + | plt.grid() | ||
| + | plt.title(' | ||
| + | i=0 | ||
| + | while True: | ||
| + | res = s.read(size=10) | ||
| + | a = int.from_bytes(res[2: | ||
| + | b = int.from_bytes(res[4: | ||
| + | print(" | ||
| + | plt.scatter(i, | ||
| + | plt.scatter(i, | ||
| + | plt.legend([r' | ||
| + | plt.pause(0.05) | ||
| + | i+=1 | ||
| + | s.close() | ||
| + | </ | ||
| + | |||
| + | |||
| + | {{: | ||
arduino/sds011.1578153943.txt.gz · Last modified: by aistis
