how to read a large number of data from Serial?

I want to read a lot of data(about 40000+ bytes) from serial. and I just read it( by using readChar()) and print it, than it wil crash. I want to know that if I was wrong or Processing can't handle that much data from Serial?

Tagged:

Answers

  • edited March 2014

    If by print you meant using Processing's print() or println() functions,
    just know that the console provided by Processing's IDE can't handle too much! :-O

    Perhaps you may try getting a compiled ".jar" and run it from a console terminal! :-??

  • Actually I want to read an image through Serial. Print is for debugging, so if I don't use print(). Is there any other way to know what't the program going on? Thanks!

  • Well, print to a file! 8-|

  • Thank you first. Then I got another problem that I saved all the data in a String and its length is correctly. but sometimes(actually it's about 80%) Processing can receive the first 12 bytes data(it's the answer packet) but can't receive the followed data packets(30032 bytes). readChar() returns 0xffff. I don't know why?

Sign In or Register to comment.