Go Down

Topic: MPL115A2 change SPI pin communication (Read 585 times) previous topic - next topic

Prof

I got a MPL115A2 adafruit sensor on a Arduino uno r3 board.

I use the <Adafruit_MPL115A2.h> Library.

The SCL and SDA of the MPL115A2 are respectly connected to analog pin 5 and 4 on the arduino.

I also have a XBEE pro 900 module connected to the arduino board.

Question: I want to free the analog pin 5 and 4 on the arduino and put the SPI communication of the MPL115A2 on digital pin 9 and 8 of the arduino.

IF someone can help.....thank a lot to the community for the help....very appreciate....
;)
Alain

Erdin

What makes you think the sensor can be used in SPI mode ?

Why do you want to free pin A4 and A5 ?
Perhaps you could use a mux to be able to select more analog signals.

Prof

Excuse I was wrong not SPI but I2C communication and if I could change SCL and SDA (Ana5 and Ana4) on Arduino Uno I'll not have to multiplex.

Thank for the help

Alain

Erdin

On a Arduino boards, the I2C pins are fixed to certain pins, You can not change it.

For the Arduino Uno it is A4 and A5, at the cost of 2 analog inputs.
The Arduino Mega 2560 has 16 analog inputs.
http://arduino.cc/en/Main/arduinoBoardMega2560
The Arduino Leonardo has 12 analog inputs.
http://arduino.cc/en/Main/arduinoBoardLeonardo

Nick Gammon wrote a page about using a mux.
http://www.gammon.com.au/forum/?id=11976

Go Up