08-03-2012 09:25 PM
According to the datasheet for the VCNL4000 there is only one device address and therefore you can only use one sensor with a single I2C master. You only have one I2C master.
If you have the board from sparkfun.com, it basically explains all you need to know in the description as far as hooking it up goes.
08-04-2012 07:11 AM
Nathan, I tried your VI's but I couldn't get it work. Can you send me a basic VI for this sensor? I am constantly getting time out error. Thanks a lot.
08-04-2012 06:37 PM
Where is the timeout occuring? Is it from my VI? These VIs are as basic as they get.
08-05-2012 05:09 AM
Hello Nathan,
I added the VI. Please tell me what is wrong.
Thanks a lot.
08-05-2012 07:02 AM
Nathan GOOD NEWS. I tried the VI I sent for the last time after I send my last message guess what it was working!!!!. Thanks a lot for your help. I don't know why but this keeps happening to me. I don't understand what's wrong but sometimes I don't get my LIFA working. I always check if things are working with VIs which are I am sure about. I always restart my computer and everything. This time nothing helped till now which I didn't do anything different. Is it only me or Is it some kind of bug?
Also VI show 19.9mm when it is closest to an object. I guess It should be otherwise.
08-05-2012 11:39 AM
I'm glad to hear that you got it working.
I can't think of anything in my code that would cause inconsistent results. The one that that I would say could cause strange results is the OS and connection to the Arduino. So, it really depends on the error you've been getting.
From my experience if you are too close to the sensor, you get strange readings. If the distance is reading correctly 90% of the time then I'm quite sure that there is nothing I can do, directly, with the code to "fix" it.