Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Problems with getADC function

Discussion forum for the BasicX family of microcontroller chips.

Problems with getADC function - Daniel Navascués Benito - Jul 7 12:33:00 2000

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]





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: Problems with getADC function - Frank Manning - Jul 7 15:05:00 2000

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




(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )