As I wrote, it is just your code without the Serial stuff:
- PrintWriter output;
- void setup() {
- output = createWriter( "newp.txt" );
- }
- void draw() {
- String value = "Some stuff";
- if ( value != null ) {
- output.println( value );
- output.close();
- }
- }