1

i am working on this arduino project using processing. There are some sensor values which should be logged, but unfortunately my processing code rewrites the file after each cycle so that i get the last sensor value only. How do i prevent this from happening? I am using the ordinary method by the way. PrintWriter command followed by createWriter

asked Apr 5, 2015 at 4:38

1 Answer 1

1

PrintWriter pw = new PrintWriter(new FileOutputStream( new File("persons.txt"), true /* append = true */));

The true is the append mode flag. Also check if you're using

pw.append(p.toString()); pw.append("sdf");

https://stackoverflow.com/questions/8210616/printwriter-append-method-not-appending

answered Apr 5, 2015 at 8:32

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.