If 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 …
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)
I’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)