An application to log WiFi SSIDs for position lookup testing
Dependencies: C027_Support SWO mbed-rtos mbed picojson
Fork of lpc4088_ebb_ublox_Cellular_PubNubDemo_rtos by
measurement/AnalogMeasurement.cpp@1:cac9b2960637, 2015-02-15 (annotated)
- Committer:
- rosterloh84
- Date:
- Sun Feb 15 22:04:12 2015 +0000
- Revision:
- 1:cac9b2960637
First working version. Lots to do still.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rosterloh84 | 1:cac9b2960637 | 1 | #include "AnalogMeasurement.h" |
rosterloh84 | 1:cac9b2960637 | 2 | |
rosterloh84 | 1:cac9b2960637 | 3 | AnalogMeasurement::AnalogMeasurement(AnalogIn& analog1, AnalogIn& analog2) : |
rosterloh84 | 1:cac9b2960637 | 4 | _analog1(analog1), |
rosterloh84 | 1:cac9b2960637 | 5 | _analog2(analog2) |
rosterloh84 | 1:cac9b2960637 | 6 | { |
rosterloh84 | 1:cac9b2960637 | 7 | _init = false; |
rosterloh84 | 1:cac9b2960637 | 8 | } |
rosterloh84 | 1:cac9b2960637 | 9 | |
rosterloh84 | 1:cac9b2960637 | 10 | bool AnalogMeasurement::init() |
rosterloh84 | 1:cac9b2960637 | 11 | { |
rosterloh84 | 1:cac9b2960637 | 12 | if (_init) |
rosterloh84 | 1:cac9b2960637 | 13 | return false; |
rosterloh84 | 1:cac9b2960637 | 14 | |
rosterloh84 | 1:cac9b2960637 | 15 | _init = true; |
rosterloh84 | 1:cac9b2960637 | 16 | return true; |
rosterloh84 | 1:cac9b2960637 | 17 | } |
rosterloh84 | 1:cac9b2960637 | 18 | |
rosterloh84 | 1:cac9b2960637 | 19 | bool AnalogMeasurement::run() |
rosterloh84 | 1:cac9b2960637 | 20 | { |
rosterloh84 | 1:cac9b2960637 | 21 | float analog1 = _analog1.read(); |
rosterloh84 | 1:cac9b2960637 | 22 | float analog2 = _analog2.read(); |
rosterloh84 | 1:cac9b2960637 | 23 | |
rosterloh84 | 1:cac9b2960637 | 24 | printf("A0: %.2f A1: %.2f", analog1, analog2); |
rosterloh84 | 1:cac9b2960637 | 25 | |
rosterloh84 | 1:cac9b2960637 | 26 | return true; |
rosterloh84 | 1:cac9b2960637 | 27 | } |