Arduino Sketch for HMC5832 Compass via I2C
$30-100 USD
Paid on delivery
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
<[url removed, login to view]>
<[url removed, login to view]>
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:
<[url removed, login to view]>
<[url removed, login to view]>
Furthermore, you will need to download the following software in order to develop the sketch and test it.
<[url removed, login to view]>
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 );
? ?
? ? [url removed, login to view]( readings[0] );
? ? [url removed, login to view]( readings[1] );
? ? [url removed, login to view]( readings[2] );
}
Project ID: #3248775