Skip to content

readByte()

Arnd edited this page Dec 25, 2020 · 1 revision

readByte(address)

This function is used to communicate directly with the VCNL4010 and read a byte from 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
uint8_t interrupt_status_register_value = Sensor.readByte(VCNL4010_INTERRUPT_STATUS_REG);
Serial.print("Interrupt Status Register has the value ");
Serial.print(interrupt_status_register_value,BIN);
Serial.println(".");