Pages: [1]   Go Down
Author Topic: MPL115A2 change SPI pin communication  (Read 529 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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....
 smiley-wink
Alain
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 27
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Edison Member
*
Karma: 58
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: