Skip to content

i2c iic links

2014/07/05

I2C fundamentals and Microcontroller /Arduino stuff:

Sketch to scan for the adress of devices connected to the i2c bus:
http://www.mathias-wilhelm.de/arduino/assets/downloads/i2cScanner.zip

I got a cheap I2C interface for character LCDs I wanted to use with the arduino duemillanove from ebay. The seller was emall4you. The board is fine but the description was wrong. The sample code said to use the i2c adress 20 but the board needed 27. The sample also said that some changes to the liquidCrystal_I2C code are needed. I didn’t get the beast running . What saved me is a piece of code in a discussion ( http://forum.arduino.cc/index.php/topic,183775.0.html ) that showed the usage of a differnt lib and the correct initialisation.

Code snippet:
#include
#include
#include <LiquidCrystal_I2C.h>

#define I2C_ADDR 0x27
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

Used librarry: https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home

Additional infos, examples http://arduino-info.wikispaces.com/LCD-Blue-I2C

Advertisements

From → i2c

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: