Assignment 16

Задание 16


In which my computer talks to me

В котором компьютер говорит со мной

IDE + PDE

To make my application, I decided to use Processing because I'm thinking of getting to know java a bit deeper and this skill will be useful (I hope that I won't drop it a couple of days later). It was a good surprise for me that Processing PDE interface was similar to Arduino IDE and that's not a coincidense because Arduino inherited it during development. So, I took my sketch for input device assignment (pre-evaluation edition, you have to push the button there to see that site) and a pcb with a hand attached to it and started looking for examples.

This is a tutorial I used

  import processing.serial.*;
Serial port;
float capacity = 0;

void setup()
{
  size(300,300);
  port = new Serial(this, "COM26", 9600);
  port.bufferUntil('\n');
  textSize(20);
}
void draw()
{ if (capacity>400){
  background(0,0,capacity);
  println(capacity);
  text("Somebody touched me! 0_0 ",25,120);
  text(capacity,100,200);}
  else 
{
  background(0,0,capacity);
  println(capacity);
  text("Sleeping, zzz ",75,120);
  text(capacity,100,200);}
}
void serialEvent (Serial port)
{
  capacity = float(port.readStringUntil('\n'))/1024*255;
}
  

Lapser, Gleb Miroshnik, Fab Academy 2016

Lapser, Глеб Мирошник, Фаб Академия 2016