mbed-os
Fork of mbed-os by
features/unsupported/tests/benchmarks/all/main.cpp@0:f269e3021894, 2016-10-23 (annotated)
- Committer:
- elessair
- Date:
- Sun Oct 23 15:10:02 2016 +0000
- Revision:
- 0:f269e3021894
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | #include "mbed.h" |
elessair | 0:f269e3021894 | 2 | |
elessair | 0:f269e3021894 | 3 | DigitalOut out(p5); |
elessair | 0:f269e3021894 | 4 | #if defined(TARGET_LPC1114) |
elessair | 0:f269e3021894 | 5 | AnalogIn in(p20); |
elessair | 0:f269e3021894 | 6 | #else |
elessair | 0:f269e3021894 | 7 | AnalogIn in(p19); |
elessair | 0:f269e3021894 | 8 | #endif |
elessair | 0:f269e3021894 | 9 | |
elessair | 0:f269e3021894 | 10 | volatile float w, x, y, z; |
elessair | 0:f269e3021894 | 11 | int main() { |
elessair | 0:f269e3021894 | 12 | while(1) { |
elessair | 0:f269e3021894 | 13 | z = x * y / w; |
elessair | 0:f269e3021894 | 14 | printf("Hello World %d %f\n", out.read(), z); |
elessair | 0:f269e3021894 | 15 | if(in > 0.5) { |
elessair | 0:f269e3021894 | 16 | out = !out; |
elessair | 0:f269e3021894 | 17 | } |
elessair | 0:f269e3021894 | 18 | } |
elessair | 0:f269e3021894 | 19 | } |