Create Form, write to .txt string file, and read from it dynamically

edited March 2016 in How To...

Greetings all,

I'm trying to create a single project in Processing to do all the things I need. Here's what I'd like to do:

  1. Have a single text entry box that would allow a user to type in a set number of characters.
  2. a "submit" button that would then write this text to a .txt file as part of a running string / data store
  3. Upon hitting submit, another item from the string .txt file would be called up and printed to a thermal printer that I have hooked to an Arduino Uno (that has firmata loaded up).

I know how to do these things separately using HTML, PHP, and so on, and I can print to the thermal printer using Processing / Firmata. I'm just looking for insight and guidance to try and do all this in one fell swoop.

Any time and direction is greatly appreciated.

Thank you.

Answers

  • For the textfield and button it is easier to use one of the gui libraries. G4P and ControlP5 are there for your choice.

    Now, the .txt part. You can easily save text files using saveStrings(). You can send the same text to Arduino using Serial port or directly program Arduino instructions in processing using special library. Do you really need a txt file to be submitted? Because if you have string it is easier to just send it to printer.

Sign In or Register to comment.