![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
main.cpp
- Committer:
- gbeardall
- Date:
- 2011-10-17
- Revision:
- 0:c055a2cae8b6
File content as of revision 0:c055a2cae8b6:
/* * servo1: main.cpp - test program * */ #include <assert.h> #include "mbed.h" #include "Servo.h" DigitalOut led1(LED1); DigitalOut led2(LED2); DigitalOut led3(LED3); DigitalOut led4(LED4); Serial pc(USBTX,USBRX); Servo servo(p21); // --------------------------------------------------------------------------- int main() { pc.printf("\n\rStart: servo1\n\r"); // sweep servo for(int i=0; i<1; ++i) { for( float p=0; p<=1.0; p+=0.01) { servo = p; wait(0.01); } // for for( float p=1.0; p>=0; p-=0.01) { servo = p; wait(0.01); } // for } // for - i fprintf(stdout, "stdout1\n\r"); fprintf(stderr, "stderr1\n\r"); assert(1); // if false; just exits (no msg to stderr) fprintf(stdout, "stdout2\n\r"); fprintf(stderr, "stderr2\n\r"); exit(0); } // main // ---------------------------------------------------------------------------