سلام به اساتید محترم
من می خوام دو ماژول قطب نمای CMPS09 را به یک AVR از طریق I2C وصل کنم که برای این کار نیاز دارم که آدرس یکی از ماژول ها را تغییر بدم.چند روز با این مآژول ها ور رفتم ولی نتونستم آدرس تغییر بدم لطفاً کمکم کنید. :sad:
من می خوام دو ماژول قطب نمای CMPS09 را به یک AVR از طریق I2C وصل کنم که برای این کار نیاز دارم که آدرس یکی از ماژول ها را تغییر بدم.چند روز با این مآژول ها ور رفتم ولی نتونستم آدرس تغییر بدم لطفاً کمکم کنید. :sad:
کد:
[b]Changing the I2C Bus Address[/b] To change the I2C address of the CMPS10 you must have only one module on the bus. Write the 3 sequence commands in the correct order followed by the address with 100ms between writes. Example; to change the address of a compass currently at 0xC0 (the default shipped address) to 0xC2, write the following to address 0xC0; (0xA0, 0xAA, 0xA5, 0xC2 ) with a 100ms delay after each of the first three bytes. These commands must be sent in the correct sequence to change the I2C address, additionally, No other command may be issued in the middle of the sequence. The sequence must be sent to the command register at location 22, which means 4 separate write transactions on the I2C bus. When done, you should label the CMPS10 with its address, however if you do forget, just power it up without sending any commands. The CMPS10 will flash its address out on the LED. One long flash followed by a number of shorter flashes indicating its address. The flashing is terminated immediately on sending a command the CMPS10.
دیدگاه