Discussion forum for the BasicX family of microcontroller chips.
|
--- 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... > > > > > > __________________________________________________ |