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.
Revision 0:c65547fd8960, committed 2010-02-18
- Comitter:
- okano
- Date:
- Thu Feb 18 12:20:26 2010 +0000
- Commit message:
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 |
diff -r 000000000000 -r c65547fd8960 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Feb 18 12:20:26 2010 +0000
@@ -0,0 +1,50 @@
+/*
+ * mbed demo code
+ *
+ * This code has been made for a training session.
+ *
+ * Copyright (c) 2010 NXP Semiconductors Japan
+ * Released under the MIT License: http://mbed.org/license/mit
+ *
+ * revision 1.0 18-Feb-2010 1st release
+ */
+
+#include "mbed.h"
+
+PwmOut led[] = { LED4, LED3, LED2, LED1 };
+
+int main() {
+
+ unsigned char rate = 0;
+
+ while ( 1 )
+ {
+ led[ 0 ] = rate / 255.0;
+ led[ 2 ] = rate / 255.0;
+ led[ 1 ] = 1- (rate / 255.0);
+ led[ 3 ] = 1- (rate / 255.0);
+ rate++;
+
+ wait( 0.01 );
+ }
+}
+
+
+#if 0
+ for ( int i = 0, r = rate; i < 4; i++, r += 32 )
+ led[ i ] = ((r & 0x80) ? (unsigned char)(~r) : (unsigned char)r) / 255.0;
+
+ rate += 4;
+
+ wait( 0.01 );
+#endif
+
+#if 0
+ led[ 0 ] = (unsigned char)rate / 255.0;
+ led[ 2 ] = (unsigned char)rate / 255.0;
+ led[ 1 ] = 1- ((unsigned char)rate / 255.0);
+ led[ 3 ] = 1- ((unsigned char)rate / 255.0);
+ rate++;
+
+ wait( 0.01 );
+#endif
\ No newline at end of file
diff -r 000000000000 -r c65547fd8960 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Feb 18 12:20:26 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0