Rihards Balass / 4DGL-mbed-32PTU
Revision:
8:b634ac9c92f8
Parent:
7:f064ae670553
Child:
9:32eb75c01e9d
diff -r f064ae670553 -r b634ac9c92f8 Picaso_4DGL-32PTU_graphics.cpp
--- a/Picaso_4DGL-32PTU_graphics.cpp	Mon Sep 12 11:33:12 2016 +0000
+++ b/Picaso_4DGL-32PTU_graphics.cpp	Mon Sep 12 12:12:09 2016 +0000
@@ -431,10 +431,34 @@
     command[4] = (y >> (8*1)) & 0xff;
     command[5] = (y >> (8*0)) & 0xff;
     
-    writeCOMMAND(command, 8);
+    writeCOMMAND(command, 6);
+    getResponse(1);
+}
+
+//**************************************************************************
+// The Draw Line & Move Origin command draws a line from the current origin 
+// to a new position. The Origin is then set to the new position. 
+// The line is drawn using the current object colour, using the 
+// “Set Graphics Parameters” – “Object Colour” command. The line may be 
+// tessellated with the “Line Pattern” command.
+// 
+// Note: this command is mostly useful with the “Calculate Orbit” command, 
+// and usually the “Draw Line” command would be used
+//**************************************************************************
+void PICASO_4DGL :: lineTo(short x, short y) {
+    
+    char command[6] = "";
+    
+    command[0] = (LINE_TO >> (8*1)) & 0xff;
+    command[1] = (LINE_TO >> (8*0)) & 0xff;
+    command[2] = (x >> (8*1)) & 0xff;
+    command[3] = (x >> (8*0)) & 0xff;
+    command[4] = (y >> (8*1)) & 0xff;
+    command[5] = (y >> (8*0)) & 0xff;
+    
+    writeCOMMAND(command, 6);
     getResponse(1);
 }
 
 
 
-