Compass Using Arduino

by MennaH4 in Circuits > Arduino

1140 Views, 15 Favorites, 0 Comments

Compass Using Arduino

12953219_985350394852983_1181259174_o.jpg
12953082_985352758186080_1884033442_o.jpg

I made a compass using
1-Arduino Mega
2-LSM303 sensor
3-coloured LCD sheild
4- 4 male/female wires .
Please follow the steps for connection description and the full code .

The Connection

12968520_985350538186302_1309581662_n.jpg
12986738_985352468186109_1417777767_o.jpg
12953122_985350464852976_1775758461_o.jpg

1-Put the colour lcd sheild on the top of the arduino mega (it will perfectly fit).
2-Connect the four wires using female terminal to the LSM303 pins as in attached photos and the other male terminal to the arduino mega to the corresponding pins ( 5v , GND ,SDA,SCL )

The Code

12952934_985352701519419_425423788_o.jpg

I used the two attached libraries(not my own libraries) in my code
1- color lcd shield library which will be imported easily.
2-lsm303 library which I needed to extract firstly before importing and import the folder called "lsm303" only .
and attached my code called "compass'" .