// Homeostasis // external, homeostatic projection import processing.serial.*; Serial btPort, usbPort; // Create object from Serial class int val; // Data received from the serial port int LF = 10; void setup() { size(200, 200); println(Serial.list()); btPort = new Serial(this, Serial.list()[6], 9600); usbPort = new Serial(this, Serial.list()[0], 9600); val=197; usbPort.write(val); println("wrote val"); } void draw() { while (btPort.available() > 0) { val = btPort.read(); usbPort.write(val); // converting that reading to voltage, for 3.3v arduino use 3.3 float voltage = val * 5.0 / 1024; float temp = voltage/0.01; // with single +supply, LM34 is 10.0 mV/deg F print(millis()); print(" "); print(val); print(" : "); print(temp); println(" F"); // } } }