Alexandre Lemay / Mbed 2 deprecated APP1_s5_A17

Dependencies:   mbed MMA8452

Revision:
2:3576839565ae
Child:
6:909e7877d915
Child:
7:b1b4db3eedb4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Afficheur.cpp	Mon Sep 04 22:57:54 2017 +0000
@@ -0,0 +1,39 @@
+
+
+#include "Afficheur.h"
+
+    Afficheur::Afficheur():afficheur(p5,p6,p7),chipSelect(p8)
+    {
+        afficheur.format(8,0);
+        afficheur.frequency(50000);
+        chipSelect = 0;
+    }
+    
+    void Afficheur::write(char* characters,int length ) 
+    {
+        static char buf[20];
+        resetDisplay();
+        afficheur.write(characters,length,buf,20);      
+    }
+    void Afficheur::write(char ch)
+    {
+        static char buf[1];
+        afficheur.write(&ch,1,buf,1);
+    }
+    void Afficheur::resetDisplay()
+    {
+        char buf[1];
+        afficheur.write("v",1,buf,1);
+    }
+    void Afficheur::showDot()
+    {
+        char command[2] = {'w',2};
+        char buf[2];
+        afficheur.write(command,2,buf, 2);
+    }
+    void Afficheur::hideDot()
+    {
+        char command[2] = {'w',0};
+        char buf[2];
+        afficheur.write(command,2,buf, 2);
+    }
\ No newline at end of file