-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Describe your sensors | ||
===================== | ||
|
||
Sensors are described in special files named `sensorXXXX.ssr` where XXXX stands for the sensor that contain `raspardas.py`. | ||
|
||
``CREATE THE .SSR FILEs`` | ||
------------------------ | ||
In the example below, four sensors are created and saved to `.ssr` files. | ||
:: | ||
|
||
from ardas import sensor_tools as st | ||
# Saves a set of sensors including its calibration in a binary '.ssr' file | ||
sensors = (st.FMSensor(sensor_id='0001', processing_parameters=(-16.9224032438, 0.0041525221, -1.31475837290789E-07, | ||
2.39122208189129E-012, -1.72530800355418E-017), | ||
quantity='temp.', units='°C', output_format='%6.3f', log_output=True), | ||
st.UncalibratedFMSensor(sensor_id='0002', log_output=False), | ||
st.UncalibratedFMSensor(sensor_id='0003', log_output=True), | ||
st.UncalibratedFMSensor(sensor_id='0004', log_output=True), | ||
) | ||
|
||
if __name__ == '__main__': | ||
for s in sensors: | ||
print(s.sensor_id + ' - ' + s.quantity + ' : ' + s.output_repr(10000)) | ||
s.save() | ||
print('reload sensor...') | ||
s = st.load_sensor('1401') | ||
print(s.sensor_id + ' - ' + s.quantity + ' : ' + s.output_repr(10000) + ' Log:' + str(s.log)) | ||
|