arduino:sds011
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| arduino:sds011 [2020/01/04 16:56] – created aistis | arduino:sds011 [2020/01/06 08:23] (current) – aistis | ||
|---|---|---|---|
| Line 10: | Line 10: | ||
| https:// | 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.1578149798.txt.gz · Last modified: by aistis
