Write a sketch for the DFRobot Arduino Mega micro-controller which is capable of reading from a digital compass connected to the I2C.
The following are the components we will be using to test the sketch
<[login to view URL]>
<[login to view URL]>
The nav oard will be connected to the 3v power and to the i2c on the board.
## Deliverables
The purpose of this project is to write a sketch which will use the DF Robot Arduino Mega Microcontroller and Honeywells 3axis digital compass.
The sketch must communicate to the compass over the controllers I2C interface.?
The sketch must contain the following methods
1. int* QueryCompass(int address)
2. Setup()
3. Loop()
The sketch must only use what is available in the arduino libraries.?
Here are the components this sketch needs to work for:
<[login to view URL]>
<[login to view URL]>
Furthermore, you will need to download the following software in order to develop the sketch and test it.
<[login to view URL]>
The following is a code snippet of what would be an expected deliverable and how we would test to ensure it is working appropriately.
int* QueryCompass(int address)
{
? ? int readings[3];
? ?
? ? // ? TODO: ? implement this function
? ?
? ? return readings;
}
void setup()
{
}
void loop()
{
? ? int address = 0x00;
? ? int * readings = QueryCompass( address );
? ?
? ? [login to view URL]( readings[0] );
? ? [login to view URL]( readings[1] );
? ? [login to view URL]( readings[2] );
}