Arduino Noob here. I think once I get the hardware figured out I can start confusing myself with C code.
I have 3 sensors and a LCD shield with buttons. I board I am using is a Mega 2560.
Sensor 1) BMP180 - Has 4 pins. VIN, GND, SCL and SDA. From what I gather it is I2C compliant. I believe I need 3.3v power only to this chip.
Sensor 2) Labeled as GY-521. A 3 axis accelerometer and 3 axis gyro. Has 8 pins. VCC, GND, SLC, SDA, XDA, XCL, ADD, INT. From my reading, either 3.3v or 5v power is OK. 3.3 sounds more safe. Have not found much about this chip. I believe it is I2C complaint as well.
Sensor 3) MAP sensor for a Chevy. This will be analog. Runs off of 5v power. VIN, GND and signal.
Display w/ Buttons) Uses 6 digital lines for the display and one analog for the buttons. Also have pins for RST, 3.3v, 5v, 2 GNDs and a VIN.
My question; How do I connect the bits? I know any pin can do in or out. Does it matter what pins I use for what? With 2 I2C devices, how does that work with only a pair of I2C pins? How about splitting power to everything with only one pin marked for 3.3v and one for 5v and a pair for GND?
MPU6050. I have some demo code for it but none of it works. All has error compiling. I did manage to hack one together from various bits and cannot get a logical number out of it. The RAW seems to move fine but lots of NULLs after the Kulman. All I want is simple pitch and roll in degrees and a slight debounce so hitting a bump will not bounce it around.
MPU6050. I have some demo code for it but none of it works. All has error compiling. I did manage to hack one together from various bits and cannot get a logical number out of it. The RAW seems to move fine but lots of NULLs after the Kulman. All I want is simple pitch and roll in degrees and a slight debounce so hitting a bump will not bounce it around.
I don’t have experience myself with the modules you have. But if you need others to help you solve this problem with the code then you should at least show it. Point to where you got the code examples from. Or better if you modified it, post the code you have now. (use the Code button in the Full Post Editor and place it between the [code ]code goes here [/ code] tags ) And don’t forget the compiling errors and warnings. We won’t come far with guessing what the problem is.
Also, try to find the datasheets of the chips you are trying to interface with. It may be quite technical to understand. But does explain alot about how the devices work and what needs to be done to get sensible data. As these accelerometer/gyro thingies are rather complex. And it tells which voltage or whatever goes where, and what is safe to power it with. Tutorials made by others do cut it down to the essentials to make it work. But in general some also cut corners and connect it up in ways that might break it in the long run. Like devices not being 5 volt tolerant. (“it works for me” … but how long) If you are learning how to make the code, the last thing you want is an unreliable or dysfunctional device.