ADC
ADC.cpp@0:969bd4f60e3f, 2016-11-19 (annotated)
- Committer:
- DanielOlarte
- Date:
- Sat Nov 19 18:57:58 2016 +0000
- Revision:
- 0:969bd4f60e3f
ADC
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DanielOlarte | 0:969bd4f60e3f | 1 | #include "ADC.h" |
DanielOlarte | 0:969bd4f60e3f | 2 | |
DanielOlarte | 0:969bd4f60e3f | 3 | double adc::adcx(PinName Sen) |
DanielOlarte | 0:969bd4f60e3f | 4 | { |
DanielOlarte | 0:969bd4f60e3f | 5 | _Sen=Sen; |
DanielOlarte | 0:969bd4f60e3f | 6 | double ent; |
DanielOlarte | 0:969bd4f60e3f | 7 | AnalogIn lec1(_Sen); |
DanielOlarte | 0:969bd4f60e3f | 8 | ent = lec1.read_u16(); |
DanielOlarte | 0:969bd4f60e3f | 9 | wait(0.05); |
DanielOlarte | 0:969bd4f60e3f | 10 | ent = ent * 0.000050354; |
DanielOlarte | 0:969bd4f60e3f | 11 | return ent; |
DanielOlarte | 0:969bd4f60e3f | 12 | } |