BastatDoreau / Mbed 2 deprecated MoveYourTetris

Dependencies:   mbed APDS_9960 mbed-rtos

Dependents:   MoveYourTetris_OK

Revision:
1:ab5f440f4156
Child:
3:493dd1cf30a4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/cMatrice.cpp	Wed Mar 30 08:53:18 2016 +0000
@@ -0,0 +1,60 @@
+#include "cMatrice.h"
+
+
+cMatrice::cMatrice()
+{
+    _matrice = new unsigned char *[8];
+    for(unsigned char i = 0; i <= 7; i++)
+    {
+        _matrice[i] = new unsigned char[8];
+
+    }
+
+    for(unsigned char i = 0; i < 8 ; i++)
+    {
+        for(unsigned char j = 0; j < 8 ; j ++)
+        {
+            _matrice[i][j] = COULEUR_LED_ORANGE;
+        }
+    }
+}
+
+
+
+cMatrice::~cMatrice()
+{
+    //dtor
+}
+
+// GETTER
+unsigned char ** cMatrice::getMatrice()
+{
+
+    return _matrice;
+}
+// SETTER
+void cMatrice::updateMatrice(cForme &f)
+{
+
+}
+// METHODES
+void cMatrice::envoyerMatrice()
+{
+    DigitalOut cs(p14);
+    SPI matrice(p11,p12,p13);
+
+    
+    cs=0;
+    wait(0.5);
+    for(char i=0; i<8; i++)
+    {
+        for(char j=0; j<8; j++)
+        {
+            matrice.write(_matrice[i][j]);
+        }
+    }
+    wait(0.5);
+    cs=1;
+}
+
+