Shop OBEX P1 Docs P2 Docs Learn Events
3-Axis Compass HMC5883L & Arduino Mega 2560 — Parallax Forums

3-Axis Compass HMC5883L & Arduino Mega 2560

facemnfacemn Posts: 3
edited 2014-01-20 19:05 in General Discussion
I've purchased the 3-Axis Compass HMC5883L module, and have hooked it up to my Arduino Mega 2560 board. I've wired the ground and power appropriately, with the SCL > A5 and SDA > A4. The serial monitor shows -1 for all three of the X, Y, Z axis. However, if I wire it up to my Arduino Uno into the same pins, I get actual readings. What gives?

Best,

Jason

Comments

  • TCTC Posts: 1,019
    edited 2014-01-20 13:07
    No disrespect, but if you look to the top of the page you will see "Parallax Forums". You might want to check out an Arduino forum. I would assume you would have a better chance to finding the answer to your problem.
  • facemnfacemn Posts: 3
    edited 2014-01-20 13:18
    Doh, good point. I'll ask there.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-20 13:57
    I agree you'll probably have better luck on an Arduino forum but there are a lot of Arduino uses around here too. A lot of Parallax's tutorial now appear to give Arduino examples. If you can't bet them? . . .
  • GadgetmanGadgetman Posts: 2,436
    edited 2014-01-20 14:11
    You are aware that the Uno and the Mega2560 have different pinouts?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-01-20 14:16
    As Gadgetman says, the functionality of pins differs between the Uno and Mega. On the Mega, SCL and SDA are pins 21 and 20, respectively.

    Be sure to review the documentation for the board you are using. In some cases connecting things wrong can damage the Arduino. An Arduino Due cannot tolerate 5V inputs, for example.

    To off-quote from someplace else, "This isn't your father's Arduino any more."
  • facemnfacemn Posts: 3
    edited 2014-01-20 19:05
    /facepalm

    Thanks so much guys. Didn't catch that those were in a different spot on the Mega board. I'm still new to all of this! I've got it working now. :)
Sign In or Register to comment.