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:0dd118824ead, committed 2010-02-05
- Comitter:
- jonbichel
- Date:
- Fri Feb 05 16:11:05 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 0dd118824ead main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Feb 05 16:11:05 2010 +0000
@@ -0,0 +1,64 @@
+#include "mbed.h"
+#include "DigitalOut.h"
+
+//fading LED's on mbed
+//feb 5 2010
+
+PwmOut lda(P1_18);
+PwmOut ldb(P1_20);
+PwmOut ldc(P1_21);
+PwmOut ldd(P1_23);
+
+int main() {
+
+
+ lda=ldb=ldc=ldd= 1;
+ ldb=ldd= 0;
+
+ while (1) {
+ while (lda < 1) {
+ lda = lda + 0.02;
+ ldb = ldb - 0.01;
+ ldc = ldc + 0.05;
+ ldd = ldd - 0.005;
+ wait(0.01);
+ }
+
+ while (lda > 0) {
+ lda = lda - 0.02;
+ ldb = ldb - 0.01;
+ ldc = ldc + 0.01;
+ ldd = ldd + 0.005;
+ wait(0.01);
+ }
+
+ // lda = !lda;
+ while (lda < 1) {
+ lda = lda + 0.02;
+ ldb = ldb + 0.01;
+ ldc = ldc + 0.005;
+ ldd = ldd - 0.015;
+ wait(0.01);
+ }
+
+ while (lda > 0) {
+ lda = lda - 0.02;
+ ldb = ldb + 0.01;
+ ldc = ldc - 0.02;
+ ldd = ldd + 0.015;
+ wait(0.01);
+ }
+
+
+ }
+}
+//LED1 = P1_18,
+//LED2 = P1_20
+//LED3 = P1_21
+//LED4 = P1_23
+//p21 = p2_5
+//p22 = p2_4
+//p23 = P2_3
+//p24 = P2_2
+//p25 = P2_ 1
+//p26 = P2_0
diff -r 000000000000 -r 0dd118824ead mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Feb 05 16:11:05 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0