diff harelet.c @ 2:1b0ebe86b44c

Automated Vimcurial commmit
author VilyaemKenyaz
date Fri, 08 Sep 2023 07:54:05 -0400
parents 47e1b1039d7b
children eb7a7364994c
line wrap: on
line diff
--- a/harelet.c	Fri Sep 08 07:12:34 2023 -0400
+++ b/harelet.c	Fri Sep 08 07:54:05 2023 -0400
@@ -10,7 +10,8 @@
 
 #define DEEPNESS 5
 #define MAXPOINT 4096
-
+#define UNITS	"G20"
+#define SPEED	20
 
 typedef struct{
 	unsigned int X,Y,down;
@@ -60,6 +61,7 @@
  * *******************************************/
 void Compile(){
 	char * filename;
+	char * file;
 	int choice;
 
 	puts("Select your format\n1. RAW GCODE\n2. Superhare INO");
@@ -70,10 +72,32 @@
 	scanf("%s",filename);
 
 	if(choice == 1){
-
+		//Set the miller
+		strcat(file,UNITS);
+		
+		//Meat of instructions
+		for(int i = 0;i != numpoints;i++){
+		//Compose
+		char * instruction;
+		strcat(instruction,"G0 X");
+		strcat(instruction,sprintf("%d",points[i].X));
+		strcat(instruction," Y");
+		strcat(inustrction,sprintf
+		//Write to string
+		strcat(file,instruction);
+		}
+		//Finish
+		strcat(file,"G0, X0, Y0, Z0");
+		WriteFile(filename,file);
 	}
 	else{
+		//Set the miller
+		
 
+		//Meat of instructions
+	
+
+		//Finish
 
 	}
 
@@ -90,11 +114,29 @@
 void main(int argc, char* argv[]){
 	scanf("%c",&action);
 	switch(action){
-		case 'a':		numpoints++;
+		case 'a':		points[numpoints].X = X;
+					points[numpoints].Y = Y;
+					points[numpoints].down = down;
+					numpoints++;
+					break;
+		case 'h': 
+					X+=step;
+					break;
+		case 'j': 
+					Y+=step;
 					break;
-case: 
+		case 'k': 
+					Y-=step;
+					break;
+		case 'l': 
+					X-=step;
 					break;
-default:
+
+		case 's':		
+					puts("Enter new step:");
+					scanf("%d",&step);
+					break;
+		default:
 					break;
 	}
 	exit(0);