USB
Dependencies: USBDevice mbed-rtos mbed-src
Fork of TestLPCPwm by
Revision 3:26e36cda3f4f, committed 2014-11-11
- Comitter:
- littlenicky5
- Date:
- Tue Nov 11 18:48:12 2014 +0000
- Parent:
- 2:2213da8308a3
- Commit message:
- USB con main
Changed in this revision
USBDevice.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 2213da8308a3 -r 26e36cda3f4f USBDevice.lib --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Tue Nov 11 18:48:12 2014 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/teams/LSE2-2014/code/USBDevice/#7dd4ca6f4a33
diff -r 2213da8308a3 -r 26e36cda3f4f main.cpp --- a/main.cpp Sun Oct 26 17:06:47 2014 +0000 +++ b/main.cpp Tue Nov 11 18:48:12 2014 +0000 @@ -1,39 +1,14 @@ -#include <mbed.h> -#include <cmsis_os.h> -#include <stdint.h> -#include <limits.h> - -#define NUM_THREADS 6 - -PwmOut red(LED1); -PwmOut green(LED2); -PwmOut blue(LED3); - -void Timer1_Callback (void const *arg) { - red = red + 0.01; // update the counter - if(red == 1.){ - red = 0.0; - } -} +#include "USBSerial.h" +#include "mbed.h" -void Timer2_Callback (void const *arg) { - blue = blue + 0.15; // update the counter - if(blue == 1.){ - blue = 0.0; +//Virtual serial port over USB +USBSerial serial; + +int main(void) { + + while(1) + { + serial.printf(" Yeeep !\r\n"); + wait(1); } -} - -osTimerDef (timer1, Timer1_Callback); -osTimerDef (timer2, Timer2_Callback); - -int main (void) { - osTimerId id1; - osTimerId id2; - - green = 0; - id1 = osTimerCreate (osTimer(timer1), osTimerPeriodic, NULL); - osTimerStart (id1, 100UL); - id2 = osTimerCreate (osTimer(timer2), osTimerPeriodic, NULL); - osTimerStart (id2, 157UL); - green = 1; -} +} \ No newline at end of file