Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Jun 25 11:30 P.M.
- import processing.serial.*;
- int x = 0;
- int xRot;
- void setup() {
- Serial myport;
- myport = new Serial(this, "/dev/cu.usbmodem1411", 38400);
- size(800, 600, P3D);
- color c = color(255,0,0);
- background(50);
- fill(c);
- stroke(0);
- frameRate(100);
- }
- void draw() {
- //println(x); //print it out in the console
- color c = color(255,0,0);
- fill(c);
- background(0);
- translate(400,300);
- rotateZ(radians(x-90));
- //rotateX(radians(x-90));
- //rotateY(radians(x-90));
- box(200);
- //x++;
- }
- void serialEvent (Serial myPort) {
- x = myPort.read();
- //println(x);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement