sota

Dependencies:   mbed

Fork of newdot by SGMP Coperations

Revision:
3:d8133244484f
Parent:
2:d714fd7bb7d5
--- a/main.cpp	Mon Dec 11 12:35:12 2017 +0000
+++ b/main.cpp	Tue Dec 12 21:07:36 2017 +0000
@@ -8,7 +8,9 @@
 Serial pc(D1, D0);
 DigitalIn sw(USER_BUTTON);
 
-uint8_t blue[3] = {0,5,0};
+uint8_t background[3] = {0,5,0};
+uint8_t white[3] = {255,255,255};
+uint8_t blue[3] = {255,0,0};
 uint8_t green[3] = {0,255,0};
 uint8_t red[3] = {0,0,255};
 uint8_t M[3] = {0,50,100};
@@ -19,6 +21,25 @@
 uint8_t M_led[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 uint8_t I_led[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
+uint8_t S_start[8] = { 0x00, 0x62, 0x92, 0x92, 0x92, 0x8c, 0x00, 0x00 };
+uint8_t S_back[8] = { 0xFF, 0x9D, 0x6D, 0x6D, 0x6D, 0x73, 0xFF, 0xFF };
+
+uint8_t G_start[8] = { 0x00, 0x7c, 0x82, 0x92, 0x92, 0x5E, 0x00, 0x00 };
+uint8_t G_back[8] = { 0xFF, 0x83, 0x7D, 0x6D, 0x6D, 0xA1, 0xFF, 0xFF };
+
+uint8_t M_start[8] = { 0x00, 0xFE, 0x40, 0x30, 0x40, 0xFE, 0x00, 0x00 };
+uint8_t M_back[8] = { 0xFF, 0x01, 0xBF, 0xCF, 0xBF, 0x01, 0xFF, 0xFF };
+
+uint8_t P_start[8] = { 0x00, 0xFE, 0x90, 0x90, 0x90, 0x60, 0x00, 0x00 };
+uint8_t P_back[8] = { 0xFF, 0x01, 0x6F, 0x6F, 0x6F, 0x9F, 0xFF, 0xFF };
+
+uint8_t X_start[8] = { 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00 };
+uint8_t X_back[8] = { 0xFF, 0xBD, 0xDB, 0xE7, 0xE7, 0xDB, 0xBD, 0xFF };
+
+
+uint8_t O_start[8] = { 0x00, 0x18, 0x24, 0x42, 0x42, 0x24, 0x18, 0x00 };
+uint8_t O_back[8] = { 0xFF, 0xE7, 0xDB, 0xBD, 0xBD, 0xDB, 0xE7, 0xFF };
+
 char board[8][8] = {{'D','O','O','O','O','O','O','O'},
                     {'O','O','O','O','O','O','O','O'},
                     {'O','O','O','O','O','O','O','O'},
@@ -722,7 +743,7 @@
 //    pc.printf("(%2x)",y);
 //    M_led[1] = y;
 //    pc.printf("(%2x)",M_led[1]);
-
+/*
 int main(){
 
   dotmatrix.init();
@@ -741,7 +762,7 @@
   cal_i();
   
     while(1){
-        dotmatrix.display_pic(map_led,blue);
+        dotmatrix.display_pic(map_led,background);
         dotmatrix.display_pic(hero_led,green);
         dotmatrix.display_pic(boss_led,red);
         dotmatrix.display_pic(M_led,M);
@@ -765,3 +786,63 @@
         }
     }
 }
+*/
+/*
+int main(){
+    
+    int i = 0;
+
+    dotmatrix.init();
+    
+    while(1){  
+        while(i<1000){
+            dotmatrix.display_pic(S_start,red);
+            dotmatrix.display_pic(S_back,green);
+            i = i + 1;
+        }
+        i = 0;
+        while(i<1000){
+            dotmatrix.display_pic(G_start,red);
+            dotmatrix.display_pic(G_back,green);
+            i = i + 1;
+        }
+        i = 0;
+        while(i<1000){
+            dotmatrix.display_pic(M_start,red);
+            dotmatrix.display_pic(M_back,green);
+            i = i + 1;
+        }
+        i = 0;
+        while(i<1000){
+            dotmatrix.display_pic(P_start,red);
+            dotmatrix.display_pic(P_back,green);
+            i = i + 1;
+        }
+        i = 0;
+    }
+
+}
+*/
+
+int main(){
+    
+    int i = 0;
+
+    dotmatrix.init();
+    
+    while(1){  
+        while(i<500){
+            dotmatrix.display_pic(X_start,white);
+            dotmatrix.display_pic(X_back,white);
+            i = i + 1;
+        }
+        i = 0;
+        while(i<500){
+            dotmatrix.display_pic(O_start,white);
+            dotmatrix.display_pic(O_back,green);
+            i = i + 1;
+        }
+        i = 0;
+    }
+
+}
\ No newline at end of file