Advertisement
Guest User

Processing-Dimmer

a guest
Nov 24th, 2014
203
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void setup() {
  2.  
  3. size(256, 150);
  4.  
  5. println("Available serial ports:");
  6.  
  7. println(Serial.list());
  8.  
  9. port = new Serial(this, Serial.list()[4], 9600);
  10.  
  11. }
  12.  
  13. void draw() {
  14.  
  15. // draw a gradient from black to white
  16.  
  17. for (int i = 0; i < 256; i++) {
  18.  
  19. stroke(i);
  20.  
  21. line(i, 0, i, 150);
  22.  
  23. }
  24.  
  25. port.write(mouseX);
  26.  
  27. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement