summaryrefslogtreecommitdiff
path: root/tmk_core/tool/mbed/mbed-sdk/libraries/tests/benchmarks/all/main.cpp
blob: a3794f10051e832f3a77071bdfcbe6fe9bbc63f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "mbed.h"

DigitalOut out(p5);
#if defined(TARGET_LPC1114)
AnalogIn in(p20);
#else
AnalogIn in(p19);
#endif

volatile float w, x, y, z;
int main() {
    while(1) {
        z = x * y / w;
        printf("Hello World %d %f\n", out.read(), z);
        if(in > 0.5) {
            out = !out;
        }
    }
}