Writing to a text file at regular intervals using createWriter, and a boolean w/ a %-based timer
in
Programming Questions
•
11 months ago
I have a sketch that currently writes output erratically (in terms of intervals between writes) to a text file using createWriter, but I want to bring it under the control of a timer. I
The sketch works fine until I add some variant of:
The rest of the code works fine, it's just this one conditional that I don't understand/can't get to work.
I got the framework for what I'm doing in the code above from an included example (file IO => SaveFile2) and then the excellent blog post here: http://amnonp5.wordpress.com/2012/01/28/25-life-saving-tips-for-processing/
The sketch works fine until I add some variant of:
- if (millis() % 100 == 0){
- output.println("text" + millis());
- }
- if (frameCount % 10 == 0){
- output.println("text" + millis());
- }
- void draw():
The rest of the code works fine, it's just this one conditional that I don't understand/can't get to work.
I got the framework for what I'm doing in the code above from an included example (file IO => SaveFile2) and then the excellent blog post here: http://amnonp5.wordpress.com/2012/01/28/25-life-saving-tips-for-processing/
1