What I'm trying to make is a G code interpreter who can sends signals to an arduino board. So the arduino board can control a simple CNC router to draw a circuit over a PCB.
I hope this project inspirer some peoples to support, improve, and make this things gonna real.
Any suggestions, comments, bug, improvement, please send to me.
Remove these ads by
Signing UpStep 1The Processing code.
On the next step I will shoe how to generate the G file, and use my code to draw the PCB on screen.
The file named as 12.txt is a G file to use as example.
The file named as "motor shield" is a example already routed on the eagle. You just need to generate the G-file.
The file named as "teste" is simple example already routed on the eagle. You just need to generate the G-file too.
| « Previous Step | Download PDFView All Steps | Next Step » |








































void setup()
{
size(1000,1000);
background(0);
}
int ESCALA = 2;
int offsetx=0,offsety=0;
void draw()
{
String lines[] = loadStrings("12.txt");
for(int i=3;i String[] strx = split(lines[i], 'X');
int[] x=int (split(strx[1],'Y'));
strx = split(strx[1],'Y');
int[] y=int (split(strx[1],'D'));
strx = split(strx[1],'D');
int[] d= int (split(strx[1],'*'));
println(x[0]);
println(y[0]);
println(d[0]);
if(d[0]==2) move((x[0]/100*ESCALA),(y[0]/100*ESCALA));
if(d[0]==1) anda(x[0]/100*ESCALA,y[0]/100*ESCALA);
}
}
void move(int x1,int y1){
println("move");
strokeWeight(5);
stroke(255);
point(x1,y1,0);
offsetx=x1;
offsety=y1;
println(x1);
println(y1);
println("fin move");
}
void anda(int x,int y){
int countx=offsetx,county=offsety;
smooth();
strokeWeight(2.0);
strokeCap(ROUND);
line(countx,county,x,y);
offsetx=x;
offsety=y;
}
Also, did you make further progress with this project since you built the Instructable?
Thanks in advance
{
size(700,700);
}
int ESCALA = 2;
int offsetx=0,offsety=0;
void draw()
{
String lines[] = loadStrings("14.txt");
for(int i=3;i String[] strx = split(lines[i], 'X');
strx = split(strx[1],'Y');
String[] stry = split(strx[1],'D');
String[] D= split(stry[1],'*');
if(int(D[0])==2) move(int(strx[0])/100*ESCALA,int(stry[0])/100*ESCALA);
if(int(D[0])==1) anda(int(strx[0])/100*ESCALA,int(stry[0])/100*ESCALA);
}
while(true){
}
}
void move(int x,int y){
strokeWeight(5.0);
offsetx=x;
offsety=y;
println(" moveu");
//point(x,y);
}
void anda(int x,int y){
int countx=offsetx,county=offsety;
smooth();
strokeWeight(2.0);
strokeCap(ROUND);
line(countx,county,x,y);
offsetx=x;
offsety=y;
}
i love your project!
Bom ver que é do brasil!
Quando terminar minha CNC, irei testar...
Abraço
abraço e obrigado
can you send me those files at
jordan2_delta@hotmail.com please
thanks
anyway, I will send it t tou,
cya