Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
libraries/tests/benchmarks/all/main.cpp@0:6c56fb4bc5f0, 2016-11-04 (annotated)
- Committer:
- nexpaq
- Date:
- Fri Nov 04 20:27:58 2016 +0000
- Revision:
- 0:6c56fb4bc5f0
Moving to library for sharing updates
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| nexpaq | 0:6c56fb4bc5f0 | 1 | #include "mbed.h" |
| nexpaq | 0:6c56fb4bc5f0 | 2 | |
| nexpaq | 0:6c56fb4bc5f0 | 3 | DigitalOut out(p5); |
| nexpaq | 0:6c56fb4bc5f0 | 4 | #if defined(TARGET_LPC1114) |
| nexpaq | 0:6c56fb4bc5f0 | 5 | AnalogIn in(p20); |
| nexpaq | 0:6c56fb4bc5f0 | 6 | #else |
| nexpaq | 0:6c56fb4bc5f0 | 7 | AnalogIn in(p19); |
| nexpaq | 0:6c56fb4bc5f0 | 8 | #endif |
| nexpaq | 0:6c56fb4bc5f0 | 9 | |
| nexpaq | 0:6c56fb4bc5f0 | 10 | volatile float w, x, y, z; |
| nexpaq | 0:6c56fb4bc5f0 | 11 | int main() { |
| nexpaq | 0:6c56fb4bc5f0 | 12 | while(1) { |
| nexpaq | 0:6c56fb4bc5f0 | 13 | z = x * y / w; |
| nexpaq | 0:6c56fb4bc5f0 | 14 | printf("Hello World %d %f\n", out.read(), z); |
| nexpaq | 0:6c56fb4bc5f0 | 15 | if(in > 0.5) { |
| nexpaq | 0:6c56fb4bc5f0 | 16 | out = !out; |
| nexpaq | 0:6c56fb4bc5f0 | 17 | } |
| nexpaq | 0:6c56fb4bc5f0 | 18 | } |
| nexpaq | 0:6c56fb4bc5f0 | 19 | } |