diff harelet.c @ 11:1d4df12de9e3

Automated Vimcurial commmit
author VilyaemKenyaz
date Tue, 12 Sep 2023 08:05:11 -0400
parents c73aed540bdd
children 35e6a7b53e3c
line wrap: on
line diff
--- a/harelet.c	Tue Sep 12 07:17:22 2023 -0400
+++ b/harelet.c	Tue Sep 12 08:05:11 2023 -0400
@@ -15,7 +15,7 @@
 #endif
 
 #ifdef _WIN32
-#include <Windows.h>>
+#include <windows.h>>
 #include <conio.h>
 #endif
 
@@ -33,7 +33,7 @@
 point points[MAXPOINT];
 
 unsigned int X = 100;
-unsigned int Y = 100;
+unsigned int Y = 25;
 unsigned int step = 5;
 unsigned int down = 0;
 unsigned int numpoints = 0;
@@ -88,12 +88,12 @@
  * Date - Sep 08 2023
  * *******************************************/
 void Compile(){
-	/*
+	
 	char * filename;
 	char * file;
 	char buffer[sizeof(int)*8+1];
 	int choice;
-
+	clrscr();
 	puts("Select your format\n1. RAW GCODE");
 	scanf("%d",&choice);
 
@@ -110,13 +110,16 @@
 			//Compose
 			char * instruction;
 			strcat(instruction,"G0 X");
-			itoa(points[i].X,buffer);
 			strcat(instruction,buffer);
+			//Convert X to string
+			sprintf(buffer,"%d",&points[i].X);
 			strcat(instruction," Y");
-			itoa(points[i].Y,buffer);
+			//Convert Y to string
+			sprintf(buffer,"%d",&points[i].Y);
 			strcat(instruction,buffer);
+			//Convert Z to string
+			sprintf(buffer,"%d",5);
 			strcat(instruction," Z");
-			itoa(DEEPNESS,buffer);
 			strcat(instruction,buffer);
 			//Write to string
 			strcat(file,instruction);
@@ -126,9 +129,9 @@
 		WriteFile(filename,file);
 	}
 
-	puts("Finished Compiling");
+	puts("Finished Compiling GCODE");
 
-	*/
+	
 }
 
 
@@ -144,7 +147,7 @@
 		//New CONIO controls
 		switch(getchar()){
 		case 'h': 
-			X += step;
+			X -= step;
 			break;
 		case 'j': 
 			Y += step;
@@ -153,7 +156,7 @@
 			Y -= step;
 			break;
 		case 'l': 
-			X -= step;
+			X += step;
 			break;
 
 		case 's':