I thinking of a project where I'll need a Wifi shield and a LCD shield both running together. Is this possible and if so, how?
Jim
I thinking of a project where I'll need a Wifi shield and a LCD shield both running together. Is this possible and if so, how?
Jim
What is i2r?
I2c, spi, serial?
Senso:
What is i2r?
I2c, spi, serial?
of course I meant i2c, sorry.
Jim
I2C is designed for chaining - just connect both devices to the SDA and SCK lines, and make sure they have nonconflicting addresses.
Aeturnalus:
I2C is designed for chaining - just connect both devices to the SDA and SCK lines, and make sure they have nonconflicting addresses.
Thanks for the reply! How does the Arduino specify the device address? I assume that means I could stack I2C shields by just giving them different addresses.
Jim
The wiring.h library is used for I2C. Your program will contain the device address and the data you are sending it.
Here's the correct thing to call out, I was a little off:
#include <Wire.h> // bring in Wire Library
//Then you can set up some addresses to use, these are for MAX6953 for example:
// I2C device address is 1 0 1 A3 A2 A1 A0 with AD1, AD0 both low
#define COMMAND_ADDRESS (0x50);
#define CONFIG_ADDRESS (0x04);
#define INTENSITY10_ADDRESS (0x01);
#define INTENSITY32_ADDRESS (0x02);
#define SCANLIMIT_ADDRESS (0x03);
#define DIGIT0_ADDRESS (0x60);
#define DIGIT1_ADDRESS (0x61);
#define DIGIT2_ADDRESS (0x62);
#define DIGIT3_ADDRESS (0x63);
and send a command, I did this in Setup to get ready for Loop:
void setup() {
// start up I2C, uses Analog 5 for Clock, Analog 4 for data
Wire.begin(); // nothing in () because we are the master
/* Need this stuff now?? Try with & without, Wire.h & Wire.begin might do it for you:
// define stuff to use for ShiftOut
// SCL, SDA, BLINK
//set pins to output so you can control the shift register
pinMode(Blink, INPUT); // Blink
pinMode(clockPin, OUTPUT); // SCL
pinMode(dataPin, OUTPUT); // SDA
*/
// Send config register address
Wire.beginTransmission(address);
Wire.send(COMMAND_ADDRESS);
Wire.send(CONFIG_ADDRESS);
// Connect to device and the byte
Wire.send(0x01); // low byte
Wire.endTransmission();