Nieuwe kinematica + potmeter
Dependencies: HIDScope MODSERIAL QEI biquadFilter mbed
Fork of Project_script_union_potmeter by
Diff: main.cpp
- Revision:
- 2:2f4444f1504d
- Parent:
- 1:40470bc517f1
- Child:
- 3:a3ad58758696
--- a/main.cpp Mon Sep 11 10:42:39 2017 +0000 +++ b/main.cpp Tue Sep 11 15:05:35 2018 +0000 @@ -3,17 +3,25 @@ DigitalOut myled(LED_GREEN); MODSERIAL pc(USBTX, USBRX); +DigitalIn button(PTA4); int main() { - int i = 0; + char c; + c = pc.getc(); + pc.baud(115200); pc.printf("Hello World!\r\n"); - while (true) { - wait(0.5f); // wait a small period of time - pc.printf("%d \r\n", i); // print the value of variable i - i++; // increment the variable - myled = !myled; // toggle a led + while (true) + { + myled==1; + + if (button==0) + { + wait(0.5f); // wait a small period of time + pc.printf("%c \n",c); + myled = !myled; // toggle a led + } } }