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.
Fork of 00_LAB_matrix8x8_SPI by
Diff: main.cpp
- Revision:
- 1:b732136485e0
- Parent:
- 0:61199d9d0aed
- Child:
- 2:414129d953dd
--- a/main.cpp Wed Mar 15 20:45:14 2017 +0000
+++ b/main.cpp Wed Mar 15 21:47:38 2017 +0000
@@ -10,7 +10,7 @@
#define uint8_t unsigned char
-uint8_t vcol[8]={0,0,0,0,0,0,0,0};
+
void sendSPI(uint8_t d1, uint8_t d2)
{
@@ -33,19 +33,31 @@
};
+void print_Snake()
+{
+ //reset
+ uint8_t vcol2[8]={0,0,0,0,0,0,0,0};
+ uint8_t vcol[8]={0,1,3,7,0xf,0x1f,0x3f,};
+ int j, i;
+ for (j=0; j<8;j++){
+ for (i=0; i<8;i++){
+ vcol2[j]=i;
+ printMatrix(vcol2);
+ wait_ms(5);
+ }
+ }
+}
int main() {
+ uint8_t vcol[8]={0,0,0,0,0,0,0,0};
sendSPI(0x0c,1);
sendSPI(0x0F,1);
- wait (1);
+ wait (0.1);
sendSPI(0x0f,0);
- wait (1);
+ wait (0.1);
int i =0;
while(1){
- i ++;
- vcol[1]=i;
- printMatrix(vcol);
- wait(0.5);
+ print_Snake();
}
}
// ***************************************************************************
