Coder Social home page Coder Social logo

teensy-samples's Introduction

teensy-samples

teensy-samples's People

Contributors

theremingenieur avatar tni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

teensy-samples's Issues

Data capturing

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!

Truncate not applied correctly in PreallocatedFile::close

Thank you tni for the really interesting software.
I've found (I think) a small bug in the closure of the pre-allocated file.
I've verified this error because I've modified the source code to allow a continuous fast multi-file logging (with 8mb file size) to operate on acquisitions bigger than 2Gb (I've a 64Gb SD card) and the end of a closed file didn't match with the start of a new opened file.
The amount missed was just 512 bytes, the size of a sector.

The bug is in the instruction of the PreallocatedFile::close() function.
if(next_sector) file.truncate((next_sector - first_sector - 1) * 512 + partial_sector_len);

that should be:
if(next_sector) file.truncate((next_sector - first_sector) * 512 + partial_sector_len);

In my opinion, you shouldn't remove 1 from the difference next_sector - first_sector.
This amount is already the number of the sector of the file minus 1, because next_sector is still the last sector of the file and not the first_sector of the following file.

Reading out sensor-values

Hey there,

I was really excited when I found your code for sampling at a constant rate and even more excited when I got the "SdFatSDIO_low_latency_logger.ino"-example running for my purpose.
I (simply) want to log the signal of a PIR-sensor (motion-sensor). So I actually just changed the ISR-part like this (storage is my struct for the data that has to be saved):

void captureData() { storage.logTime = micros(); for (uint8_t i = 0 ; i < 2 ; i++) { storage.data[i] = analogRead(i); } logEntry( {storage.logTime, storage.data[0], storage.data[1]}); }

Now, when I looked at the logged data, the sample rate was perfectly constant at 1 kHz. But although I made a test measurement inside an empty room (where there was no movement at all) there were these strange peaks in the signal:
peaks_pir

These peaks seem to appear just when the Teensy is actually writing. While the code was running I simultaneously measured the signal with an oscilloscope. During the first 20 secs, where the Teensy is just waiting until it is mounted, the signal was constant and the peaks began to appear right after the start of the saving process.

The rate of peaks (from one peak to the next) is about 800 mHz, or every 1.2 seconds.

Any ideas, how to avoid the peaks?

Best regards and thank you for your time!

Logger is not filling the bin file

Hi there,
Thanks tni for this sample, really helpful! Would like to donate something for you because it is really good job.
The problem i am facing is kind of urgent.

I am writing to 2ulx1024x1024 file, each sample 16 bytes long. I have modified if full part, to start new file and repeat logging. When doing my tests I've noticed that file created is 2Mb but more than half of the file is empty with 0x00 bytes in it and the last counter is around 50k. Next file first counter is more than 100k. I've done some math and it should log around 131k of 16B to fill the file.
Any ideas?
Thanks

Compile Error

Hi, I'm trying to compile your example code in file named "SdFatSDIO_low_latency_logger.ino" using Arduino IDE but keep getting the following error.

error: 'SdFatSdioEX' does not name a type

Can you give any advice on how to compile this correctly? Maybe sdfat beta has changed since you published? Thinking this might be the case I changed back to the current version of Bill's SdFat library and now I'm getting different error as follows:

error: 'LogEntry' does not name a type

I'd be grateful if you could advise on how this can be compiled as excited to log data a high frequency without frequent lulls due to SD card writes. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.