hello,
i'm new in processing, just discover this interesting world and starting to do stuff with it ...
i know web language (as/php/js/...) and a little (very little) C/C++/C# and delphi.
this is the project i have done so far :
- i read the serial data received from an arduino (temperature) (conversion string to float)
- every second i create an average temperature with the last data and add a plot on a graph
- when the graph is full, i save all the data to a file and start a new graph
this is a visual :
problems :
- handling a big "dynamic" float array (so far i use a Table) (1 hour = 3600 float / 24 hours = 86400 float)
- saving all the data to a file when the program is closing
questions :
- i don't know how many data i have to store and the array or arrayList can't handle dynamic array ... what's the best data type for this project ?
- can't find an event to trigger when the program is closing, please tell me there is one !??
thank's
Answers
I'm flabbergasted why would you think a List wouldn't be dynamic: @-)
https://Processing.org/reference/ArrayList.html
For
float
values, I'd recommend FloatList though: https://Processing.org/reference/FloatList.htmlYou may try to
@Override
exit(): https://Processing.org/reference/exit_.htmli put arrayList aside because it use object instead of primite type (very heavy for memory) and the array can have more than 86400 float.
great !!
thank's a lot :-D