RP6conrad
Normalerweise programmieren sie so etwas in der 'Main' Schleife. Al sie Functionen sind programmiert in die lib von RP6, die muss du nicht neu einprogrammieren. Wichtig : das I2C Kompass hat eine bestimmte Adresse. Das muss naturlich eingegeben werden : sieht dan so aus : [c]// Define the addresses of our devices - in this simple example we only have
// our PCF8574:
#define PCF8574_8LEDS_ADR 0x70
// With this routine we write the data byte to the PCF8574 port:
I2CTWI_transmitByte(PCF8574_8LEDS_ADR, (~runningLight) );
// We need to invert the bits with "~" because the LEDs are
// switched on when the port is LOW. The PCF8574 can only sink
// up to 25mA of current. It is only able to source about 300µA
// of current. Thus you need to connect the cathode of the LED
// to the ports - in series with a 1K or 2K2 resistor connected to
// VDD.[/c]
So wird dan eine Byte nach das I2C Slave gesendet. Gelesen wird dan mit : I2CTWI_requestDataFromDevice(SRF_ADR, MEASURE_US_HIGH, 1);
Ist das Kompass mit der RP6 verbunden, oder mit beide (RP6 /M32).
Welchen compilierfehler hasst du ?