In urgent need of datalogger help

Status
Not open for further replies.

V_Langer

New member
Hi all,

I'm trying to write data from 3 accelerometers into a csv file using a Teensy 3.5 and the onboard SD slot. I have a bit of arduino experience and I have all three accelerometers running and putting data out over serial at about 1.5 kHz, which is acceptable for us, but I need this to get to the SD card. The problem is I can't get the board to recognize my card. The card is formatted fat32 and recognized by my computer without problem, I'm trying to use the SDfat example sketches in arduino.

My second problem is one of implementation. These examples are hundreds of lines long and I can't figure out which parts actually do the writing to sd. Does someone have a dead simple sd writing program I could reference? all I want to do is read 3 points of data from 3 accelerometers and write that in a single line in a csv

Thanks a lot, I'm coming up on a deadline for this project and could really use the help
 
Have to ask since no source code was provided, as shown in the SD card examples this setting must be used for the 'Chip Select':
// Teensy 3.5 & 3.6 on-board: BUILTIN_SDCARD
const int chipSelect = BUILTIN_SDCARD;

To confirm card function select "chipSelect = BUILTIN_SDCARD" here to see if the card list of files can be read : ...\hardware\teensy\avr\libraries\SD\examples\listfiles\listfiles.ino

Doing that here on a FAT32 formatted card works.

With that done perhaps in the sample can this be made to work : ...\hardware\teensy\avr\libraries\SD\examples\Datalogger\Datalogger.ino
 
'BUILTIN_SDCARD' was not declared in this scope

As for source code - pick any of the included examples in SDFat or SD libraries. I'm trying a ton of them and they all give me the same problem
 
'BUILTIN_SDCARD' was not declared in this scope

As for source code - pick any of the included examples in SDFat or SD libraries. I'm trying a ton of them and they all give me the same problem

I did that in p#2.

If the T_3.5 is selected it should compile without error. Though I didn't use a T_3.5 to test - the Teensy I have here worked with the indicated listfiles.ino, and I did successfully compile with IDE 1.8.12 and TD 1.51 for the Teensy 3.5.

Code:
"-tools=T:\\arduino-1.8.12\\hardware\\teensy/../tools/" -[B]board=TEENSY35[/B]
[B]Multiple libraries were found for "SD.h"
 Used: T:\arduino-1.8.12\hardware\teensy\avr\libraries\SD
 Not used: T:\arduino-1.8.12\libraries\SD
Using library SD at version 1.2.2 in folder: T:\arduino-1.8.12\hardware\teensy\avr\libraries\SD 
Using library SPI at version 1.0 in folder: T:\arduino-1.8.12\hardware\teensy\avr\libraries\SPI [/B]
"T:\\arduino-1.8.12\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-size" -A "T:\\TEMP\\arduino_build_listfiles.ino/listfiles.ino.elf"
Sketch uses 25272 bytes (4%) of program storage space. Maximum is 524288 bytes.
Global variables use 5624 bytes (2%) of dynamic memory, leaving 256512 bytes for local variables. Maximum is 262136 bytes.
 
I just verified that teensy 3.5 is selected under "Board" and that the port listed is "Com 5 (teensy 3.5)"
I really don't know what to do, I'm doing exactly what every tutorial says, inasmuch as there are any tutorials for this stuff, and I can't get anything to work at all
 
Well, you said you have a deadline - I assume you do that professionally?
You should know that we can't help with so little information. Be sure it works for others - Teensy has more than one user ;)
So.. post exactly _your_ sourcecode and the complete compilation output (all contents of the black window).
I guess you installed a 3rd party SD library and Arduino uses it for the Teensy - which is wrong. But this will tell us the output from the black window.
 
I have this working now, I had to delete my other SD library folders as the IDE defaulted to using them rather than the Teensy libraries. Thanks very much for your feedback!!
 
Again we have a case of Teensyduino conflicting with the rest of Arduino-World. Isn't it about time to recommend a separate installation of Arduino for Teensyduino without using the library manager as the standard procedure? Or would it be better to properly integrate Teensyduino into Arduino, like, for example, Expressif managed to do with their ESP?
 
I wouldn't want Arduinos slow Serial Monitor which is not fast enough for Teensy.
And it would not help for libs which are not Teensy-aware.
 
That is why I now run two installations of Arduino on each computer. One for Teensyduino, one for the rest of Arduino. No such problems so far. As said, to avoid problems in the future, this should be recommended in the TD documentation as the standard setup. A mixed setup shloud be mentioned as risky.
Actually, it is not difficult to do and much easier than constantly running into library conflicts that once solved on one side grow problems on the other.
To distinguish both on first sight when open, i've changed some lines in /lib/theme/theme.txt
Code:
# GUI - STATUS
status.notice.fgcolor = #FFFFFF
status.notice.bgcolor = #404040
status.error.fgcolor = #FFFFFF
status.error.bgcolor = #E34C00
status.edit.fgcolor = #FFFFFF
status.edit.bgcolor = #F1B500
status.font = SansSerif,plain,12

# GUI - TABS
# settings for the tabs at the top
# (tab images are stored in the lib/theme folder)
header.bgcolor = #404040
header.text.selected.color = #323232
header.text.unselected.color = #3C3C3C
header.text.font = SansSerif,plain,12
It would be nice, if the installer does this in the future, if selected to do so.
 
I have this working now, I had to delete my other SD library folders as the IDE defaulted to using them rather than the Teensy libraries. Thanks very much for your feedback!!

That's why Post#4 included and BOLDED the :: Multiple libraries were found for "SD.h" section from the console output.

IIRC That was something PAUL added back to the Arduino IDE to help make those conflicts apparent to the user.
 
There is this PORTABLE solution that can help on Linux and Windows: arduino.cc/en/Guide/PortableIDE

A single INSTALL if it finds the PORTABLE directory uses that for the local user environment.

To switch back - close the IDE and rename the PORTABLE directory to 'NOTportable' or something - perhaps one for each device if used one at a time.

It setup up the local sketchbook and preferences.txt in that folder and creates a new EMPTY personal libraries folder as well.

Code:
T:\arduino-1.8.12\portable>dir /s sketchbook *.txt

 Directory of T:\arduino-1.8.12\portable\sketchbook

03/04/2020  03:31 PM    <DIR>          libraries
               0 File(s)              0 bytes

 Directory of T:\arduino-1.8.12\portable\sketchbook\libraries

03/04/2020  03:31 PM                87 readme.txt

 Directory of T:\arduino-1.8.12\portable

03/04/2020  03:34 PM             2,396 preferences.txt
               1 File(s)          2,396 bytes

 Directory of T:\arduino-1.8.12\portable\sketchbook\libraries

03/04/2020  03:31 PM                87 readme.txt
 
Again we have a case of Teensyduino conflicting with the rest of Arduino-World. Isn't it about time to recommend a separate installation of Arduino for Teensyduino without using the library manager as the standard procedure? Or would it be better to properly integrate Teensyduino into Arduino, like, for example, Expressif managed to do with their ESP?

Oh so there really exists a method to handle this mess up with the libraries between Arduino and Teensy ! Could you please outline how this dual installation is done ?

Thanks
 
Status
Not open for further replies.
Back
Top