Códigos de Arduino y Processing para Sismografo
Códigos de Arduino y Processing para Sismografo
Códigos de Arduino y Processing para Sismografo
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
int valpwm;
float valtemp;
valtemp = (sensorValue*2500.00)/1023.00;
delay(1);
Serial.println(valtemp);
delay(1000);
Codigo de Processing
import processing.serial.*;
PrintWriter log;
void setup () {
if (nuevoDato)
{
nuevoDato = false;
stroke(127,34,255); //stroke color
strokeWeight(1); //stroke wider
line(lastxPos, lastheight, xPos, height - dato);
lastxPos= xPos;
lastheight= int(height-dato);
//log.println(millis()+","+dato);
log.println(hour()+":"+minute()+":"+second() +" , "+dato);
}
}
void exit() {
println("CErrado");
super.exit();
}
Conexión de arduino