Discussion forum for the BasicX family of microcontroller chips.
|
Hi group I'm using the getADC function (integer version) to catch data from a sensor. I've used this piece of code to do that: ---------------------------- Sub Main() Do data=getADC(InputPin) Debug.Print CStr(data) Debug.Print Chr(13);Chr(10); Call Delay(1.0) Loop End Sub ------------------------ I'm using pin 13 as input pin. I put the analog voltage coming from the sensor between pins 13 and 4 (ground). With debug.print function I'm trying to show on screen the result of the ADC conversion, an integer number that it's suppose to be between 0 and 1023. However, independently of the voltage of the source (a voltage between 0 and 5 V), it always show on screen "0". What I'm doing wrong? Thanks for your interest! [Non-text portions of this message have been removed] |
|
|
|
From: Daniel Navascués Benito <> > I'm using the getADC function (integer version) to catch data > from a sensor. I've used this piece of code to do that: > [...] > Debug.Print Chr(13);Chr(10); > [...] Just a minor comment here -- a Debug.Print with no argument will do exactly the same thing -- output carriage return/linefeed. This is also VB compatible. -- Frank Manning -- speaking only for myself |