Advertisement
Guest User

Processing code

a guest
Jul 13th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. import processing.serial.*;
  2. Serial port;
  3. float time;
  4.  
  5. void setup(){
  6.   size(600, 600);
  7.   port = new Serial(this, "COM7", 9600); // Starts the serial communication
  8. }
  9.  
  10. void draw() {
  11.   port.write((byte)((sin(time * 0.01) + 1.0) * 127));
  12.   time += 10;
  13. }
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement