ADC
ADC
This Datastream module enable to register the datastreams of Diozero Hardware module.
This datastreams corresponds to the Analog Input Pins of the device.
To access source code click here.
Dependencies
This module requires the following modules:
- Dio Zero: Provide an implementation of ADC Service that the datastream module need to provide information of each datastream.
- Event Publisher: Used to handle the incoming events and send it.
Configuration
To configure ADC Datastream module, a file named es.amplia.oda.datastreams.adc.cfg must be created with the next parameters for each input channel that you want to register:
- channelPin: -1 by default. Specify the identifier of the Analog input channel.
- getter: true by default. Enable the option to use this channel as datastream getter (have to check the value manually every time that want to know actual value).
- event: false by default. Enable the option to use this channel as datastream event (automatically will send the to the Event Handlers when a event is generated).
- min: 0.0 by default. Specifies the value that datastream will take when the hardware channel value is in the minimum of the range.
- max: 1.0 by default. Specifies the value that datastream will take when the hardware channel value is in the maximum of the range.
es.amplia.oda.datastreams.adc.cfg will have a similar format to:
1=getter:true,event:true,min:0,max:10
2=getter:true,event:false,min:1,max:18
3=getter:false,event:true,min:-10,max:40
4=getter:false,event:false,min:0,max:0