Hi Edgardo,
Ah, the double and float, always a pain to work with. I didn't realise you were reading double values.
I don't know if this helps but If you know the number of decimal places, there are couple of methods of the Arduino String class
String(val) // simple cast/convert to string
String(val, base) // optional base can be DEC, HEX or BIN
String(val, decimalPlaces) // <<< this is the one you can try like: String(0.00002, 5) should return "0.00002"
Regarding the log frequency, I have to limit it on the Community engine so everyone has a fair share of the resources as reading/writing data intensively can affect the performance for other users.
But...I know that this is for a college/university work so I have made an exception and the best I could do at the moment is to give you 60 sec log frequency.
You will have to use at the moment the testing Dev Console to set the frequency, I've given you access and it's at: https://dev26.chipchop.io (you can also have a play with the Code Builder there if you want)
If you want to log more frequently and you are ok with 100kb, you can use a simple hack, I've allowed that on purpose (here is a bit of info: https://forum.chipchop.io/post/219/)
Basically, you create an additional component, in your Arduino code you keep "buffering" the readings into it and then send it's status let's say every 60 sec (to match roughly the log frequency) with the combined readings.
It won't be perfectly organised on the log preview but it will work.
You can still keep sending in parallel the triggerEvent for the actual component as the reading happens.
Here's a simplified example to give you an idea, it doesn't matter how quickly you record, you can do it every millisecond if you want just make sure you don't exceed around 1kb as that would make the status too big to send
String log_buffer = "";
unsigned long combined_log_timer = 0;
void setup(){
..... your code
ChipChop.useClock(true); // use this if you want to track the time
}
void record_buffer(String val){
String current_time = ChipChop.Date.hour + ":" + ChipChop.Date.minute + ":" + ChipChop.Date.second; // you need to have in the setup ChipChop.useClock(true)
buffer += val + " - " + current_time + ", ";
}
void loop(){
if(millis() - combined_log_timer >= 60000){
//send everything we have collected in the last minute assuming that the component name is "logger"
ChipChop.updateStatus("logger", log_buffer);
log_buffer = ""; // empty the string
combined_log_timer = millis(); //reset the 60 sec timer
}
}
When you view the log in the Dev Console it should look something like:
0.0023 - 10:15:24, 0.0031 - 10:15:25, 0.0021 - 10:15:26 .....
or you can omit the "hour" or even the "minute" as the log entry will anyway contain it so really you just need seconds
Let me know if this works