This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Get reading from Nova PM Sensor SDS011 | |
(dust sensor, air quality sensor, PM10, PM2,5) | |
Designed to run from cron and append CSV file. | |
Script tested using Python3.4 on Ubuntu 14.04. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import logging | |
try: | |
import serial | |
except ImportError: | |
print('Python serial library required, on Ubuntu/Debian: ' + | |
'apt-get install python-serial python3-serial') | |
raise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import argparse | |
import multiprocessing | |
import random | |
import numpy as np | |
M = 250 | |
# size ~ 0.5MB | |
X = np.random.randn(M, M) |