小型化LEDピアス用

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
asagin
Date:
Sun Jul 13 15:50:54 2014 +0000
Commit message:
LED??? for LPC810

Changed in this revision

lpc810.s 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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lpc810.s	Sun Jul 13 15:50:54 2014 +0000
@@ -0,0 +1,22 @@
+;patch for lpc810
+;
+                PRESERVE8
+                THUMB
+
+                AREA    |.text|, CODE, READONLY
+
+Reset_Handler   PROC
+                EXPORT  Reset_Handler
+                IMPORT  SystemInit
+                IMPORT  __main
+                LDR     R0, =0x10000400
+                MOV     SP,R0
+                LDR     R0, =SystemInit
+                BLX     R0
+                LDR     R0, =__main+4
+                BX      R0
+                ENDP
+
+                ALIGN
+
+                END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Jul 13 15:50:54 2014 +0000
@@ -0,0 +1,34 @@
+#include "mbed.h"
+
+DigitalOut myledB(P0_0); //lpc810 dp8
+DigitalOut myledG(P0_1); //lpc810 dp5
+ 
+int main(){
+     while(1){
+
+          for( int i = 1,j=20;i<20; i++,j--){
+                      for(int k = 1;k<20;k++){
+            myledB = 1;
+            myledG = 0;   // LED No , Red , Green , Blue
+            wait_ms(i);
+            myledB = 0;
+             myledG = 1;
+            wait_ms(j);
+            }
+        }    
+        
+
+        for(int i = 20,j =0; i > 1 ; i--, j++){
+         for(int k = 1;k<20;k++){
+            myledB = 1;
+            myledG = 0;   // LED No , Red , Green , Blue
+            wait_ms(i);
+            myledB = 0;
+            myledG = 1;
+            wait_ms(j);
+            }
+        }
+
+        }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Jul 13 15:50:54 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file