VCNL4040 sensor C programming library with Raspberry

Thread Starter

guetkar

Joined Mar 9, 2022
45
Hi,

I'm using the VCNL4040 sensor (of Vishey) with Raspberry Pi 3B+, in python there is a library named "adafruit_vcnl4040", that we can import and use it. Since I'm codding it in C, it's not possible to use the same library, on the other side I didn't find any library that can be used in C (to save time and avoid developping it from scatch).

Does any know any library, or an already done script that can be used in C ?

Thank you

Karim
 

FlyingDutch

Joined Mar 16, 2021
83
Hi,

I'm using the VCNL4040 sensor (of Vishey) with Raspberry Pi 3B+, in python there is a library named "adafruit_vcnl4040", that we can import and use it. Since I'm codding it in C, it's not possible to use the same library, on the other side I didn't find any library that can be used in C (to save time and avoid developping it from scatch).

Does any know any library, or an already done script that can be used in C ?

Thank you

Karim
Hello,

there is library in C++ for Arduino - see links:
https://www.adafruit.com/product/4161

https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor/arduino

https://learn.adafruit.com/adafruit-vcnl4040-proximity-sensor/

and here is API for this C++ library described:
https://adafruit.github.io/Adafruit_VCNL4040/html/class_adafruit___v_c_n_l4040.html

Best Regards
 

FlyingDutch

Joined Mar 16, 2021
83
Hello @guetkar ,

C or C++ is basically portable from platform to platform. Of course in C++ source could be fragments that are hardware specific, but you shoukd to analyze this code and try to rewrite it for new platform. In code of such library you could find parts that are responsible of sensor behaviour. I would feel lucky if I have C++ source of library for this sensor.

Best Regards
 

nsaspook

Joined Aug 27, 2009
13,082
Top