-
Notifications
You must be signed in to change notification settings - Fork 2
Sensors underview
sberkun edited this page May 26, 2021
·
1 revision
-
YDL messages -> LowcarMessages - parameter from header mapping - parameter object - parameter name
- Which Device (arduino)
- parameter stores its parent device
- device object
- uuid (int)
- type (int)
- What value
- parameter object stores a value from header method
- Which Device (arduino)
-
LowcarMessage -> filter -> possibly a YDL message
- recognize the device and parameter
- look for parameter's
name
in device that was used - relatively trivial
- look for parameter's
- check condition using previous state
- parameter object method to determine if state change is significant
- def
- optional debounce state change significance
- parameter object method to determine if state change is significant
- build and send YDL header
- target and header saved in parameter object
- parameter object method builds YDL args from Lowcar data and optionaly previous data
- recognize the device and parameter
-
data structures:
-
device class (arduino)
- dicionary of params names to param objects
- params should be linked when added
- uuid
- type
- dicionary of params names to param objects
-
parameter class (sensor)
- name
- should_poll flag
- identifier
- YDL header (optional)
- debounce threshold (optional, default to None)
- value from header method
- is state change significant method
- construct YDL message method
-
global sensor state database dictionary
- sensor instance : [value, debounce time stamp]
-
-
debouncer:
- debouncer initialized with width w
- stores last w values
- if 70% of last w values == current value, bounce.. else debounce
- write down w -> time delay formula for posterity