so und hier noch mal die Methode aber jetzt funktioniert es :
Vielen Dank an Pascal !!!Code:int read_compass() { int data; i2c_start(0xc0); // start the I2C bus i2c_write(0xc1); // device address of the compass i2c_write(1); // memory address first part i2c_stop(); i2c_start(0xc1); // restart data = i2c_readAck(); // read 1 byte data += i2c_readNak(); // read 1 byte i2c_stop(); // stopp return data; // return the number of direction }
Lesezeichen