
.
Revision 1:a4f9276a0f35, committed 2014-05-12
- Comitter:
- wojtekmir
- Date:
- Mon May 12 11:33:36 2014 +0000
- Parent:
- 0:55d4b368d771
- Commit message:
- wst?pny program;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon May 12 11:29:57 2014 +0000 +++ b/main.cpp Mon May 12 11:33:36 2014 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +PwmOut motor(PTA5); // A green led is connected at Pin25 with resistor to ground +int motor_period = 100; + +DigitalOut myled(LED_GREEN); +Serial pc(USBTX,USBRX); + +AnalogIn ain0(PTB0); +AnalogIn ain1(PTB1); +AnalogIn ain2(PTB2); +AnalogIn ain3(PTB3); + +int main() { + +// pc.printf("\nHello World!\n"); + + motor.period_us(motor_period); + motor = 0.5f; //wypełnienie zawsze 50% + pc.baud(115200); + while (true) { + wait(0.1); + pc.printf("a0:%d\n",ain0.read_u16()); + pc.printf("a1:%d\n",ain1.read_u16()); + pc.printf("a2:%d\n",ain2.read_u16()); + pc.printf("a3:%d\n",ain3.read_u16()); + myled = !myled; + //zmiana czestotliwosci ifami tutaj + + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon May 12 11:33:36 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/8a40adfe8776 \ No newline at end of file