converting numbers(GP2D02)
Archiver
Posts: 46,084
> Subject: RE: converting numbers
>
> Um, how about:
>
> y = 225-x
Yes
> So at 225, y = 0 an at 75 it equals 150. Then you could scale it up as
> you like. Assuming it is linear, you'd use y=mx+b where m is the slope
> and b is the zero offset:
No it isn't. One experimenter said squaring the output number
made it more linear.
> y=m(255-x)+b
>
> Does that help?
>
> Um, how about:
>
> y = 225-x
Yes
> So at 225, y = 0 an at 75 it equals 150. Then you could scale it up as
> you like. Assuming it is linear, you'd use y=mx+b where m is the slope
> and b is the zero offset:
No it isn't. One experimenter said squaring the output number
made it more linear.
> y=m(255-x)+b
>
> Does that help?
Comments
"assuming it is linear" -- I was just pointing out that once you had the
range reversed you could plug it into whatever EU computation you would use.
I should have pointed out that I know nothing about the sensor itself.
Regards,
Al Williams
AWC
* Run 8 servos at once! http://www.al-williams.com/awce/pak8.htm
>
Original Message
> From: Mike DeMetz [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=wUF8vHeXSVj3rYUwRwxnrIIL70TgGGzxUW4bS6BpzNOlXP86jGfHbxD7apu81l0OfjRkeH4x1JFgUaxuqg]miked@t...[/url
> Sent: Thursday, September 28, 2000 6:46 PM
> To: basicstamps@egroups.com
> Subject: [noparse][[/noparse]basicstamps] Re: converting numbers(GP2D02)
>
>
>
> > Subject: RE: converting numbers
> >
> > Um, how about:
> >
> > y = 225-x
> Yes
> > So at 225, y = 0 an at 75 it equals 150. Then you could scale it up as
> > you like. Assuming it is linear, you'd use y=mx+b where m is the slope
> > and b is the zero offset:
> No it isn't. One experimenter said squaring the output number
> made it more linear.
> > y=m(255-x)+b
> >
> > Does that help?
>
>
>
>