Hi Omar,
I think I found at least one bug. SigmaStudio is telling you to write this combination of addresses and data:
However, judging from your code, you're writing this:
Note the discrepancy highlighted in red. It looks like you forgot to increment the subaddress (i.e. the address in parameter memory).
(You can see this in lines 21 and 30 of your pasted code)
So, the updated code should be like this:
#include <Wire.h> void setup() { Wire.begin(); } void loop() { Wire.beginTransmission(0x68); Wire.write(0x00); Wire.write(0x00); Wire.write(0x00); Wire.write(0x00); Wire.write(0x00); Wire.write(0xFF); Wire.endTransmission(); Wire.beginTransmission(0x68); Wire.write(0x00); Wire.write(0x01); Wire.write(0x00); Wire.write(0x00); Wire.write(0x06); Wire.write(0xD4); Wire.endTransmission(); Wire.beginTransmission(0x68); Wire.write(0x00); Wire.write(0x02); Wire.write(0x00); Wire.write(0x00); Wire.write(0x00); Wire.write(0x00); Wire.endTransmission(); }
You can see my changes in lines 21 and 30. Hopefully that will resolve the problem.
By the way, as you move forward in your development, you might find it useful to follow this tutorial.
http://ez.analog.com/docs/DOC-1806
It explains how to use tools within SigmaStudio to generate almost all of your microcontroller code automatically. Using that approach, you won't have as much potential for bugs caused by typos.
Let me know if this resolves the issue!