12-06-2019 06:53 AM
Hi smalhao,
@smalhao wrote:
Can any one explain one solution for that conversion?
As soon as you provide a manual describing the content of those messages from your Arduino. You (and we) need to know the formatting of your data before we can suggest how to parse those data…
12-06-2019 07:24 AM
Get rid of that flush buffer as well.
If the message is broken up into two parts separated by a line feed (which is a bad protocol for synchronization), then you are only reading the first line and probably discarding the second line.
Gerd gave you a message earlier that described what he thought the underlying math would be for the 24-bit number. Do a Scan from String with a %d format, then do the math he described.
12-11-2019 04:55 AM
I was able to talk to the developer of the code in Arduino MKR and he send to me the code in void loop function
the code is
void loop() {
if (notifySerial) {
ch1Data = AD7193.ReadADCContinuous(); //we are in Continuous mode
ch1Data=(ch1Data >> 8); //remove status register
Serial.println(ch1Data);
}
}
Additional information he gives to me:
The result is a continuous stream of strings encoding the value read by the 24-bit ADC. Each string with delimited values is displayed with special characters <Carrier Return> <Line Feed>. So looking at a serial port, what you expect to receive are the strings that look like this:
8388608
8388607
8388609
8388620
"
I hope this information help to my question, because i don't no how i can make it.
12-11-2019 05:09 AM
Make what? You were already able to read those numbers, so convert the strings to integers with %d, then apply rescaling according to the simple math we reviewed earlier.
As for the timestamp, there is no such field in the output stream, so pick the computer date and stick it yourself to the calculated voltage data.