Skip to content

writeByte()

Arnd edited this page Dec 25, 2020 · 1 revision

writeByte(address,value)

This function is used to communicate directly with the VCNL4010 and write a single byte to a specific address. It is exposed as a public function call, but all of the normal functionality of the VCNL4010 is accessible via the other calls in the library and this function is not normally required.

It is intended for advanced use where calls to I2C are to be made directly.


Example:

VCNL4010 Sensor();      // Instantiate class    
...    
while(!Sensor.begin()); // loop until initialized
writeByte(VCNL4010_LED_CURRENT_REG,(uint8_t)10); // set the current to 100mA
...