Description

setClock() modifies the clock frequency for I2C communication. I2C peripheral devices have no minimum working clock frequency, however 100 kHz is usually the baseline.

This function is part of the Wire library. See the Wire main page for more information.

Syntax

Wire.setClock(clockFrequency)

Parameters

  • clockFrequency: the desired communication clock frequency in Hertz. Common values include:

    • 10000: low speed mode (10 kHz).
    • 100000: standard mode (100 kHz).
    • 400000: fast mode (400 kHz).
    • 1000000: fast mode plus (1 MHz).
    • 3400000: high speed mode (3.4 MHz).

    Allowed data types: uint32_t.

Returns

Nothing.

Notes and Warnings

Not all clock frequencies are supported by all processors. Please refer to the specific processor documentation to verify that the desired mode is supported.