ELEC2645 (2018/19) / Mbed 2 deprecated el17cd

Dependencies:   mbed

Revision:
3:2e31dfcb712a
Parent:
2:a5bc7b3779f7
Child:
4:759a5c34e239
--- a/main.cpp	Fri Feb 22 13:45:34 2019 +0000
+++ b/main.cpp	Fri Feb 22 14:01:20 2019 +0000
@@ -10,14 +10,19 @@
 
 #include "mbed.h"
 #include <vector>
- 
+#include "Face.h"
+
 #include "N5110.h"
 N5110 lcd(PTC9,PTC0,PTC7,PTD2,PTD1,PTC11);
 
-
  
 int main()
 {
+    float p[4][3] = {{1,0,0},{0,0,0},{0,0,0},{0,0,0}};
+    char buffer[50];
+    Face f(p);
+    int n=sprintf (buffer, "%f", f.GetVertexValue(0,0));
+    
 
     lcd.init();
 
@@ -39,7 +44,7 @@
                 float step = (float)diffY1/(float)diffX1;
                 float stepSmall1 = (float)diffX2/(float)diffX1;
                 float stepSmall2 = (float)diffY2/(float)diffX1;
-                lcd.printString("top",0,0);
+                lcd.printString(buffer,0,0);
                 for(int s = 0; s<= abs(diffX1)-1; s++){
                     lcd.drawLine(points[0][0]+s, rint(points[0][1]+step*s), rint(points[3][0]-stepSmall1*s), rint(points[3][1]-stepSmall2*s), 0); 
                     lcd.drawLine(points[0][0]+s+1, rint(points[0][1]+step*s), rint(points[3][0]-stepSmall1*s-1), rint(points[3][1]-stepSmall2*s), 0); 
@@ -47,7 +52,7 @@
                 lcd.printString("a",10,0);
             }
             else{
-                lcd.printString("bottom",0,0);
+                lcd.printString(buffer,0,0);
                 float step = (float)diffY2/(float)diffX2;
                 float stepSmall1 = (float)diffX1/(float)diffX2;
                 float stepSmall2 = (float)diffY1/(float)diffX2;