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 | Re: HELP! SHARP GP2D12 SENSOR

Discussion forum for the BasicX family of microcontroller chips.

Re: HELP! SHARP GP2D12 SENSOR - Bill Conant - Apr 19 14:54:00 2000

--- In , Tony Brenke <trbrenke@y...> wrote:
> Thanks Tony. I'll try this and let you know what happens.
Apparently I had a few things wrong...

> well first of all the gp2d12 are analog sensors.
> you need to use your AD converter to mesure these.
>
> connect the yellow wire to a pin. (13 through 20 only)
>
> there are 2 versions of the "GetADC". the single
> version and the integer version.
>
> the single version will return a % of 5 volts.
> so for a 2.4 volt signal the return would be near .48
>
> sub main()
> dim volt as single
> const pin as byte = 13
>
> call Getadc(pin,volt)
> ' volt for a 2.4 would be 0.48
> end sub
>
> for the integer version
> this is on a scale of 0 to 1023
> sub main()
> dim volt as integer
> const pin as byte = 13
>
> volt = Getadc(pin)
> ' volt for a 2.4 would be 491 or 492.
> ' about 4.88 mv per integer
> end sub >
> --- Bill Conant <> wrote:
> > I need help with code to run 2 Sharp sensors as
> > inputs on my 'bot.
> > I'm
> > new to the BX24 and appreciate any and all help.
> > Email me also at
> > thanks...
> >
> >
>
> __________________________________________________




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