Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kaufmanno committed Feb 9, 2018
1 parent 6c5fc45 commit ce2e003
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Welcome to ardas documentation!
parse_and_push_to_db
build_arduino_sketch
commands
sensors
settings

Indices and tables
Expand Down
28 changes: 28 additions & 0 deletions docs/source/sensors.rst
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))

0 comments on commit ce2e003

Please sign in to comment.