public static byte [ ] i2cConfigRequest ( int delayInMicroseconds ) { if ( delayInMicroseconds < 0 ) { throw new IllegalArgumentException ( "Delay cannot be less than 0 microseconds." ) ; } if ( delayInMicroseconds > 255 ) { throw new IllegalArgumentException ( "Delay cannot be greater than 255 microseconds." ) ; } byte delayLsb = ( byte ) ( delayInMicroseconds & 0x7F ) ; byte delayMsb = 0 ; if ( delayInMicroseconds > 128 ) { delayMsb = 1 ; } return new byte [ ] { START_SYSEX , I2C_CONFIG , delayLsb , delayMsb , END_SYSEX } ; }
Creates SysEx message that configures I2C setup .