Teensy LC - MPU6050 I2C. How to pullup +3.3V?

Status
Not open for further replies.
Hey, thanks for the quick answer. That misunderstanding is exactly what I did. Here is a (sketchy) diagram of my circuit, updated after your post, and some pictures. I haven't noticed any change. I'm using 5K1 resistors.
image1.jpgimage2.jpgimage3.jpgimage4.jpgimage5.jpg
 
Looks like you've connected SDA & SCL to pins 23 & 22. That can (probably) work, but only if you do special stuff on the software side to cause whatever library or other code you're using to use Wire1.

Until you get it working, I highly recommend using pins 18 & 19. Almost all examples are written to use those pins. Get it working first on the normal pins.
 
Okay, I'm on pins 18 and 19 now, which I'm ok with using. I'm trying to run @linuxgeek's code (not sure if you can tag people like that here) - it compiles fine, and I get down to "setup 2", then nothing. I see there's a reference to I2C_PINS_16_17 right after "setup 1", and I haven't got anything attached to pins 16 and 17. Am I missing something simple?
 
With I2C hooked to pins 18 and 19, try running Wire lib Scanner example (from IDE Examples > Wire > Scanner) and see if Wire lib sees your I2C device.
Code:
Scanning...
Device found at address 0x68  (DS1307,DS3231,MPU6050,MPU9050,MPU9250,ITG3200,ITG3701,LSM9DS0,L3G4200D)
done

I have a Sparkfun MPU6050 that works with the following sketch
https://github.com/kriswiner/MPU6050/blob/master/MPU6050BasicExample.ino

Code:
MPU6050 is online...
x-axis self test: acceleration trim within : 0.6% of factory value
y-axis self test: acceleration trim within : 0.6% of factory value
z-axis self test: acceleration trim within : 0.8% of factory value
x-axis self test: gyration trim within : 0.2% of factory value
y-axis self test: gyration trim within : -0.2% of factory value
z-axis self test: gyration trim within : 0.3% of factory value
Pass Selftest!
MPU6050 initialized for active data mode....
X-acceleration: -2.20 mg Y-acceleration: 3.11 mg Z-acceleration: 998.84 mg
X-gyro rate: 0.1 degrees/sec Y-gyro rate: 0.0 degrees/sec Z-gyro rate: 0.0 degrees/sec
Temperature is 27.07 degrees C

X-acceleration: -0.73 mg Y-acceleration: 3.23 mg Z-acceleration: 1000.92 mg
X-gyro rate: -0.1 degrees/sec Y-gyro rate: 0.0 degrees/sec Z-gyro rate: -0.1 degrees/sec
Temperature is 27.09 degrees C
and the linuxgeek sketch works after changing the begin() in the sketch to use pins 18, 19
Code:
0
1
2
3
4
setup1
setup2
setup3
660,-48,14834
692,0,14832
682,-20,14802
654,-26,14830
...
 
Last edited:
Thanks manitou!! That got it working. I missed the bit about pins 18 and 19 on my previous look through the code, clearly. :) Sorry for the delayed reply, I've been busy lately. Much appreciated! Same to you, Paul Stoffregen!
 
Status
Not open for further replies.
Back
Top