I would like to create an associative array. I believe I can benefit of the key/value type of array for simplicity reasons. For example, I could have key/values:
PH/2.85,
EC/700,
TEMP/72
I have never dealt with arrays in Arduino and have absolutely no idea where to begin. The project I am working on has three sensors which are a ph, ec, and temp sensors. They calculate the data then send it to a C# program which listens for the serial data. The C# application is working great, but I am having trouble figuring out a strategy for storing the sensor data. Any ideas are greatly appreciated.
If you can, keep hashes/associative arrays in C#, where memory is cheap, and out of the Arduino, where it is dear. Instead, have the Arduino serialize its data in an easy-to-produce format, using plain print statements. On the C# end, you can use a library, if needed, to deserialize the data.
Simplest might be serialize the data in CSV format:
Or you can serialize the data in JSON format:
Then, on the C# end, use a json library to turn this into a hash in one easy step.