level 1
超搞笑℃
楼主
本人正在做一个32*32RGB点阵,需要用processing来控制。
我用的是processing作为上位机,传输一个坐标给arduino,现在就在传输程序上卡住了。
下面是processing的程序:
void setup() { size(640, 640);
ellipseMode(CENTER);
}
void draw()
{ }
void mousePressed(){
for(int x=0 ;x<width;x=x+20){
for(int y=0;y<width;y=y+20){
// stroke(255,0,255);
// fill(128,128,128);
// background(0,128,128);
int d=20;
if ((mouseX > x) && (mouseX < x+20) &&
(mouseY > y) && (mouseY < y+20)){
//rect(mouseX, mouseY, 20, 20);
fill(0);
}else {
fill(255);
}
rect(x,y,d,d);
}
}
}
2013年07月07日 07点07分
1
我用的是processing作为上位机,传输一个坐标给arduino,现在就在传输程序上卡住了。
下面是processing的程序:
void setup() { size(640, 640);
ellipseMode(CENTER);
}
void draw()
{ }
void mousePressed(){
for(int x=0 ;x<width;x=x+20){
for(int y=0;y<width;y=y+20){
// stroke(255,0,255);
// fill(128,128,128);
// background(0,128,128);
int d=20;
if ((mouseX > x) && (mouseX < x+20) &&
(mouseY > y) && (mouseY < y+20)){
//rect(mouseX, mouseY, 20, 20);
fill(0);
}else {
fill(255);
}
rect(x,y,d,d);
}
}
}
