I have an application where I want to read a few values from the Spark module. But I would prefer to read them all at ones, and then have them returned simultaneously. The obvious way to do this appears to be through the Spark.variable function, since there is no way to return anything but an Integer through the Spark.function function.
The thing is, I want to reset the values that I am reading when I do the read. I suppose I could expose functions and variables to do the following, but it is not what I would call ‘elegant’:
- Gather: Take the values, place them into a string, and reset the original values
- Download: Send the string to the user through the Spark.variable function
A preferred solution, at least from my point of view since I am guessing that string returns from functions are not likely to be supported any time soon, would be a callback that could let my program know when a variable has been read. I could be keeping the string buffer up to date, and then clear the underlying counters when the variable is read.
Thanks for any assistance
P.S. I now have a FM24C256 FRAM working with the Spark. I will make a post in the next few days on my experiences interfacing it