Does the Teensy 3.0 run on an Arduino IDE.
Hi Paul,
I have an related question but I am not starting a new post for this one little question. Does the Teensy 3.0 run on an Arduino IDE. I want to run the MPU9150 on a Teensy 3.0.
void getMotion9(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz);
void getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz);
I also took a quick look inside their code. It's based on Jeff Rowberg's original code (like FreeIMU and many others). The "getMotion" functions correctly use int16_t pointers. Earlier versions had trouble on 32 bit boards because they assumed "int" was 16 bits. This looks like it was based on the newer, fixed version.
Code:void getMotion9(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz); void getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz);
How did you get it to run at a 13ms spacing? Jeff's example code includes a hard 20 ms delay to prevent getting incorrect data from the magnetometer. Without the delay, it returns gyroscope data (for some odd reason).
I'm running mine at ~1.7ms per sample (~600 Hz), but only by skipping the magnetometer. It's hard to say what the problem is without seeing how you modified the code.
Download the whole library at https://github.com/jrowberg/i2cdevlib/tree/master/Arduino
There is one folder for AK8975, in the file AK8975.cpp, in the function AK8975::getHeading you will see a delay of 10 millisecond. You should be able to go down to 8ms. Lower it should not work or the sensor will give you twice the same value before updating, I haven't tried.
I am not aware of a "fast" magnetometer on the market. Probably you should first try to calibrate the device (I failed here) to output reasonable values regarding its position in space.
The function AK8975::getHeading(... uses delay(10) only one time. If you call X, Y, and Z separately you will need a delay for each call. Study and try the examples and you will see.
I also took a quick look inside their code. It's based on Jeff Rowberg's original code (like FreeIMU and many others). The "getMotion" functions correctly use int16_t pointers. Earlier versions had trouble on 32 bit boards because they assumed "int" was 16 bits. This looks like it was based on the newer, fixed version.
Code:void getMotion9(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz, int16_t* mx, int16_t* my, int16_t* mz); void getMotion6(int16_t* ax, int16_t* ay, int16_t* az, int16_t* gx, int16_t* gy, int16_t* gz);
When I disconnect the Teensy 3.0 from the computer and reconnect it back then why do the programmes stop running.
I do not get any reading on the serial monitor. Even when I press the reset button I still do not get any reading on the serial monitor except zeros. Moreover when I press the reset button then COM port is no longer visible on the Arduino IDE. Please help me resolve these problems.
Can you see how incomplete this question is, without details of how your board gets its power?
Presumably you're using Windows? That matters, because Microsoft's drivers have a bug where unplugging the USB while a program has the port open can result in leftover junk left in the Windows Registry. The driver's bugs cause it to not recognize the device again when it's reconnected. Sometimes plugging into another port solve the problem. Rebooting usually fixes it too. This is a special problem on Windows. Mac and Linux have much higher quality drivers.
But even without the Windows bug, if you leave the serial monitor window open, it keeps that instance of the serial port in use. None of the 3 operating systems is designed to reconnect the same USB device to an already-open session. It would be nice if things worked that way, but that's simply not the way it works. When you disconnect (or reprogram the board, which is the same as disconnecting the cable as far as the software is concerned), the serial monitor can no longer communicate with the device. You have to quit the serial monitor, reconnect the device, and then open it again. On Linux, if a program has the old device open, a new name gets assigned, so you also may need to find and select the port again in the Tools > Serial Port menu.
Of course, on Windows there is the extra problem that the driver may not recognize the device when its reconnected if junk got left over in the Windows Registry. That extra problem is unique to Windows. There are only 2 solutions.... #1: be careful to close whatever if accessing the port before you reprogram (in Arduino, the serial monitor automatically closes when you click Upload, but not when you press the pushbutton), or #2: use Mac or Linux.
Is there any other alternative where I can connect a microSD card to save the data from the Teensy 3.0. This is a critical requirement I am looking for.
http://www.pjrc.com/store/sd_adaptor.html
http://forum.pjrc.com/threads/16758-Teensy-3-MicroSD-guide
I would use sdfat's example sketches. He has a ton of them in his library.
I would suggest using the microsd adapter by pjrc, since many of us have used it, and it works well.
I use a 32gb microsd card with it. I'm pretty sure it'll support 64gb. It might mention it in the README file.
Good idea to use what others have used that have good write speeds. Typically class 10 is what you want. But brand-to-brand may vary.