I am using an Mathematica to process code within an Arduino that in the end will display the current temperature of the thermocouple attached.
I can run DeviceExecute and get a temperature. However, I have been trying
Dynamic[temp, UpdateInterval -> 0.5]
Out= Dynamic[23.25, UpdateInterval -> 0.5]`
to no avail, as the temperature is not output in real time, only when I request it using DeviceExecute.
Any thoughts as to get data real time without having to run the command?
Dynamic is spelled wrong. But what is wrong with using deviceexecute?
It was spelled right when I attempted it code, believe me. I don't want to have to use DeviceExecute to get the temperature. I am aiming to collect temperatures every 10 seconds or so for nearly 24 hours.
Sorry, but I had to assume you spelled it wrong because you showed an input and corresponding output with the misspelling before editing it.
As to your question, You have given no details of your code so I can only give you the general workflow...
Look at ScheduledTask and set your read to happen every 10 seconds. the workflow should look like this:
Use Dynamic to display the constantly updating temperature variable with
or a more elegant variation -- Setting a nice background graphic or Font, color, etc.
You can log your temperature history by having the scheduled task append to a variable (say "tempLog"). Your Dynamic can then stay the same (showing the last value of temperature) or be updated to
When you are done you should stop the ScheduledTask and close the Device.
I hope this helps.
I got it to work with your help. I very much appreciate it.