tni / teensy-samples Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
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!
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.
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:
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!
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
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.