Wire Library question

Hi there!
Help me please : how to setup different speed for wire conversation?
Actualy i would like to use slow TWI speed (instead of 100 or 400 standart).
as i see Wire.begin() has no Parameters ?

--
Thanks!

There is no method for TWI speed modification in Wire class. You have 2 possibilities I think.

  1. In ..\Wire\utility\twi.h there is defined TWI_FREQ, you can change this.
  2. To modify TWBR register after Wire.begin() call in your code.

and tell me pls , this header file( \Wire\utility\twi.h ) works only for Wire example , or for every user project?
and how to make shure , that the perfect header file works in the project? for ex. : i see two files
..Arduino\hardware\tools\avr\avr\include\avr\iom168.h and
..Arduino\hardware\tools\avr\avr\include\avr*iom168p*.h . What file will be used for project , when checked Arduino pro with Atmega168 as board ? (actually it is atmega168pa chip in my project)

Library is used for each project then a change in the library file (e.g. twi.h) will be used for each. You can create a clone for yourself and put it to sketch folder or into user library folder etc. There are more options how to.

MCU type is defined in boards.txt. Based on selected board MCU's header file is used according MCU type. During buid process you can see in the log which one is used, but you have to swith on more detailed info (File->Preferences->Show verbose output during: compilation (check)). Somewhere in log you can see command line. The option -mmcu tell you which MCU type is actually used for building. ATmega168PA has separate header file: avr\iom168pa.h. This one should be used I think. See also avr\io.h for info.