Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. //Jun 25 11:30 P.M.
  2. import processing.serial.*;
  3. int x = 0;
  4. int xRot;
  5. void setup() {
  6. Serial myport;
  7. myport = new Serial(this, "/dev/cu.usbmodem1411", 38400);
  8. size(800, 600, P3D);
  9. color c = color(255,0,0);
  10. background(50);
  11. fill(c);
  12. stroke(0);
  13. frameRate(100);
  14. }
  15.  
  16. void draw() {
  17. //println(x); //print it out in the console
  18. color c = color(255,0,0);
  19. fill(c);
  20. background(0);
  21. translate(400,300);
  22. rotateZ(radians(x-90));
  23. //rotateX(radians(x-90));
  24. //rotateY(radians(x-90));
  25. box(200);
  26. //x++;
  27. }
  28. void serialEvent (Serial myPort) {
  29. x = myPort.read();
  30. //println(x);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement