Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
taurian69
taurian69's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Save TXT
[4 Replies]
24-Mar-2012 08:40 AM
Forum:
Core Library Questions
Hello
I'm
trying to record
values
coming from a
temperature sensor
in a document
.
TXT
but the
code
I'm using
does not
write anything
..
thanks
import processing.serial.*;
Serial port;
PrintWriter output;
void setup() {
// Open the port that the board is connected to and use the same speed
port = new Serial(this, "COM11", 9600);
// file to store your incoming data
output = createWriter("teste.txt");
}
void draw() {
background(255);
if (0 < port.available()) {
// read it and store it in val
char val = (char)port.read();
output.print(val);
print(val);
}
}
void stop(){
// Writes the remaining data to the file
// and closes it before closing sketch
output.flush();
output.close();
println("Data Saved");
super.stop();
}
«Prev
Next »
Moderate user : taurian69
Forum