A Clark
/
RF_ID
Log Test Code
Fork of VoltageThreshold by
main.cpp@0:e99407475b62, 2014-03-18 (annotated)
- Committer:
- ajclark2
- Date:
- Tue Mar 18 15:15:47 2014 +0000
- Revision:
- 0:e99407475b62
- Child:
- 1:2178a66e1223
Temp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ajclark2 | 0:e99407475b62 | 1 | #include "mbed.h" |
ajclark2 | 0:e99407475b62 | 2 | |
ajclark2 | 0:e99407475b62 | 3 | AnalogIn ain_v1(p20); |
ajclark2 | 0:e99407475b62 | 4 | AnalogIn ain_v2(p19); |
ajclark2 | 0:e99407475b62 | 5 | |
ajclark2 | 0:e99407475b62 | 6 | int main() |
ajclark2 | 0:e99407475b62 | 7 | { |
ajclark2 | 0:e99407475b62 | 8 | float v1, v2; |
ajclark2 | 0:e99407475b62 | 9 | int value1, value2; |
ajclark2 | 0:e99407475b62 | 10 | |
ajclark2 | 0:e99407475b62 | 11 | v1 = ain_v1; |
ajclark2 | 0:e99407475b62 | 12 | v2 = ain_v2; |
ajclark2 | 0:e99407475b62 | 13 | |
ajclark2 | 0:e99407475b62 | 14 | // Thresholded voltages as found in testing |
ajclark2 | 0:e99407475b62 | 15 | |
ajclark2 | 0:e99407475b62 | 16 | if(v1 >= 2.345 & v1 <= 2.310) // 824 MHz to 896 MHz |
ajclark2 | 0:e99407475b62 | 17 | { |
ajclark2 | 0:e99407475b62 | 18 | value1 = 1; |
ajclark2 | 0:e99407475b62 | 19 | } |
ajclark2 | 0:e99407475b62 | 20 | |
ajclark2 | 0:e99407475b62 | 21 | if(v1 >= 2.120 & v1 <= 2.095) // 1855 MHz to 1910 MHz |
ajclark2 | 0:e99407475b62 | 22 | { |
ajclark2 | 0:e99407475b62 | 23 | value1 = 1; |
ajclark2 | 0:e99407475b62 | 24 | } |
ajclark2 | 0:e99407475b62 | 25 | |
ajclark2 | 0:e99407475b62 | 26 | else |
ajclark2 | 0:e99407475b62 | 27 | { |
ajclark2 | 0:e99407475b62 | 28 | value1 = 0; |
ajclark2 | 0:e99407475b62 | 29 | } |
ajclark2 | 0:e99407475b62 | 30 | |
ajclark2 | 0:e99407475b62 | 31 | } |
ajclark2 | 0:e99407475b62 | 32 | |
ajclark2 | 0:e99407475b62 | 33 | |
ajclark2 | 0:e99407475b62 | 34 |