I finally had some time to look into the VCNL4200 code. According to the datasheet i found the module should not work.
You are writing to the command register at 0x80 but i would expect it to be at 0x00. Apart from that and what gordon mentioned about the usability aspect it looks good to me.
I got my VL53L0X today so i could help work on that if you like.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I finally had some time to look into the VCNL4200 code. According to the datasheet i found the module should not work.
You are writing to the command register at 0x80 but i would expect it to be at 0x00. Apart from that and what gordon mentioned about the usability aspect it looks good to me.
I got my VL53L0X today so i could help work on that if you like.