While the Teensy 3.6 is tied to instruments, it is more complex to test other circuits. I have recruited the Teensy 3.2 to help with this task. The 3.2 uses the same compiler system as the 3.6, so no need to load additional boards. It also has the same variables etc, so code should be easy to move to the 3.6. The 3.2 has allowed me to confirm that the Parallax sonar device works with the Teensy series. I have also connected the Optical Flow sensor and it seems to be working via spi as well. Finally, I have adapted a program to test the Metro library for timing. This excellent tool promises to help tame the “superloop” monster with the removal of the infamous “delay()” calls. Here are the project folders.
The next step is to update the instrument code on the 3.6 to use Metro. Once that is working, the sonar and mouse sensors can be added.
Following several weeks of sporadic effort, I now have all of the navigation and meteorology instruments working together at once. A major trick was to change the I2C address for one device to correct a conflict and also change a library to change the types to standard unsigned int and char or byte.
Here is an image of the breadboarded circuit. The met and light instruments are on the top board, while IMU and clock are on the bottom board with the processor. The red and green lights blink to tell that the data is being logged to the micro-sd card. All devices are on the I2C bus (orange and green lines on the instrument board).
The program running will display this output on the serial monitor:
Using colored LEDs, I can see how the color sensors work properly. The LSM temperature reading is way off the other two, and I am not sure why this is so.
Here is the source code:
Each of the instrument boards needs the library from the vendor, plus you may have to change the library to match the variable types in the program code.
After the problems with the Fubarino, I purchased a Teensyduino 3.6 from a local hardware reseller. I had to buy the pins and a cable as they did not come with the board.
I was able to swap out the Fubarino 1.5 with the Teensyduino 3.6 and after testing and some reconfiguration (including loading up the Teensy plugin for the IDE) I was able to get the ahrs core to work properly. I now have a working data logger which can log the ahrs data to the micro-sd card.
See the image below to see the board as of this date: