tni / teensy-samples

BSD 2-Clause "Simplified" License
8 stars 5 forks source link

Data capturing #5

Open Paddy8 opened 5 years ago

Paddy8 commented 5 years ago

Hey there,

I got a problem implementing my Data capturing. void captureData() { ret = Dps310PressureSensor.measurePressureOnce(pressure_dps310, oversampling);; logEntry( { pressure_dps310 } ); } If I am adding my Data capturing like this, the code never starts logging Data. It stops in Line 327 in the original code.

Any suggestions what I am doing wrong?

Best regards!

imberest commented 5 years ago

Attach your code to a txt file. I can take a look. on line 327 it checks if buffer is filled, and if it is then it writes it to a SD card. It seems that you are not filling buffer. TNI is slow on answering, busy man :)

Paddy8 commented 5 years ago

Thank you for your time @imberest . There is no problem if I am trying to capture analog data.

SdDatSDIO.txt

Paddy8 commented 5 years ago

SdDatSDIO.txt Sorry, uploaded the wrong file.

imberest commented 5 years ago

From first look it seems that you are blocking writing with do while cycle. I would suggest to check it with if statement. Also you don't have time reference. I would suggest adding RTC to your circuit.

Paddy8 commented 5 years ago

I don´t think this is the problem, because everything works fine, if I am using a sensor with analog output. But in this case I need a sensor with digital output. Is it possible, that calling the sensor function: Dps310PressureSensor.measurePressureOnce(pressure_dps310, oversampling); is blocking buffer writing somehow?

But all in all thank you very much so far.

imberest commented 5 years ago

If you want i could help you with debugging, but would like to go off this comment thing. TNI will get tons of notifications, and this is not the best place to chat :) so if you have any ideas how we can get in touch privately, i will help you as much as i can.

Paddy8 commented 5 years ago

Okay, thank you. Now there is a new problem, it starts writting to the SD Card, but no bytes are written. elapsed: 9s bytes written: 0 buffer overflow count: 0 next write sector: 54693948 max buffers used during last 5s: 0 elapsed: 14s bytes written: 0 buffer overflow count: 0 next write sector: 54693948 max buffers used during last 5s: 0