Advertisement
Guest User

ohmmeter processing

a guest
Jul 28th, 2015
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. import cc.arduino.*;
  2. import processing.serial.*;
  3.  
  4. Serial port;
  5. String resistor="-";
  6. PFont font;
  7. void setup()
  8. {
  9.   String portName=Serial.list()[0];
  10.   port = new Serial(this, portName, 9600);
  11.   size(250, 250);
  12.   background(10,10,10);
  13.   smooth();
  14.   textFont(createFont("Georgia", 36));
  15.   textAlign(CENTER);
  16.  
  17. }
  18.  
  19. void draw()
  20. {
  21.   background(10);
  22.   if(port.available()>0)
  23.   {
  24.     resistor=port.readString();
  25. //    delay(10);
  26.   }
  27.   fill(255, 255, 255);
  28.  
  29.   text("Resistencia:", height/2, width/4);
  30.   text(resistor, height/2, width/2);
  31.   delay(1000);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement