Codigo de Arduino
Codigo de Arduino
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
int valpwm;
float valtemp;
// the loop routine runs over and over again forever:
void loop() {
int sensorValue = analogRead(A1);
valtemp = (sensorValue*2500.00)/1023.00;
delay(1);
Serial.println(valtemp);
delay(1000);
}
Codigo de Processing
import processing.serial.*;
void setup () {
// set the window size:
size(1800, 400);
log = createWriter("log.csv"); //Logger
// List all the available serial ports
// Check the listed serial ports in your machine
// and use the correct index number in Serial.list()[].
void exit() {
log.flush(); // Writes the remaining data to the file
log.close(); // Finishes the file
println("CErrado");
super.exit();
}
Conexión de arduino