nejcmedved
New member
Hello Teensy users!
I would like to propose for guidance for a Teensy based project.
Hardware to be used :
- Teensy 3.2, 3.5 or 3.6
- 2x MEMS accelerometer (single or triple axis)
At the moment I have one Teensy 3.2 and 2x MEMS ADXL326 wired and running.
Goals :
- Live data stream (1kHz or similar) currently implemented as :
Live stream is not so important as the high speed DAQ below. It is working good enough at the moment.
- 10kHz DAQ with Serial output at the end of acquisition.
I would like to implement 10 kHz DAQ for 1 or 2 seconds for 6 analog reads or at least 2.
Currently I do it like this :
The problem with High Speed DAQ is that if I try to enlarge arrays compiler is complaining about insufficient memory.
Could I do it with writing data to SD card or something? I am afraid it is not fast enough.
Thank you in advance for help. This is my first post on this forum but I have already used Teensy for some other projects.
Best regards,
Nejc
I would like to propose for guidance for a Teensy based project.
Hardware to be used :
- Teensy 3.2, 3.5 or 3.6
- 2x MEMS accelerometer (single or triple axis)
At the moment I have one Teensy 3.2 and 2x MEMS ADXL326 wired and running.
Goals :
- Live data stream (1kHz or similar) currently implemented as :
Code:
while(true)
{
//Read ADC values
start = micros();
x1= analogRead(A0);
..
z2=analogRead(A6);
//Serial output
Serial.print(x1);
Serial.print(";");
..
Serial.print(z2);
stop=micros();
delayMicroseconds(1000-(stop-start));
}
Live stream is not so important as the high speed DAQ below. It is working good enough at the moment.
- 10kHz DAQ with Serial output at the end of acquisition.
I would like to implement 10 kHz DAQ for 1 or 2 seconds for 6 analog reads or at least 2.
Currently I do it like this :
Code:
int zdata1[5000];
int zdata2[5000];
void HighSpeedDAQ()
{
for(int i=0;i<5000;i++)
{
zdata1[i]=analogRead(A0);
zdata2[i]=analogRead(A1);
delayMicroseconds(100-(stop-start));
}
for(int i=0;i<5000;i++)
{
Serial.print(zdata1[i]);
Serial.print(";");
Serial.print(zdata2[i]);
}
The problem with High Speed DAQ is that if I try to enlarge arrays compiler is complaining about insufficient memory.
Could I do it with writing data to SD card or something? I am afraid it is not fast enough.
Thank you in advance for help. This is my first post on this forum but I have already used Teensy for some other projects.
Best regards,
Nejc