goule Posted August 25, 2005 Report Posted August 25, 2005 Hi all,In my midibox project I use that distance sensor SHARP GP2D120; its datasheet is available here :http://document.sharpsma.com/files/GP2D120_SS_final.pdfIf I connect directly the sensor on the J5, instead of reading 0 when in IDLE (nothing in front of my sensor) I read a flow of 0 and 1 that alternates very fast, as if it hesitates between the two values. Now if I put something (that does not move) in front of the sensor, I read for instance 34 35 34 35 34 35 34 35 etc. The digit 3 is displayed constantly while the LCD oscillates between 4 and 5. >:(I know that the PIC waits for a voltage range of 0 - 5 while that sensor gives 0.3 - 3. I suppose that's the reason of flickering values ...Any idea to use that sensor correctly ? ???Thanx guys & gals,Olivier Quote
TK. Posted August 25, 2005 Report Posted August 25, 2005 Hi Oliver,according to the datasheet, the output voltage is up to Vcc+0.3V (but it can be assumed: Vcc == 5V). So, it could be that there is a problem with the connections.If you still notice the flickering values, you have to reduce the resolution of the AIN driver. The easiest way is to increase the value which is passed to MIOS_AIN_DeadbandSet (7 means: 7bit resolution, 15 means: 6bit resolution)Best Regards, Thorsten. Quote
goule Posted September 21, 2005 Author Report Posted September 21, 2005 Waw an answer from the boss himself ! :DI'll get my hands on it tonight (after a period of holidays) so ... thank you for your advice, I had already had tested this function but didn't know what was the different values possible ::)Thanks again and (forget if I repeat) Midibox is really a very very nice electro-open-source project !! Keep up the good job, your mother might be proud of you ! ;D (and forgive my bad english)SeeyaOlivier "top 10 of your greatest fans" Goule 8) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.