Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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 |
--- /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
--- 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
