- This topic has 0 replies, 1 voice, and was last updated 12 years, 6 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › Program to interface 8-bit PCF8591 ADC with P89V51RD2 MICROcontroller.
My project involves Sharp IR distance measuring sensor GP2D120 having a range of 4cm to 30cm. I’m using an 8-bit PCF8591 ADC with P89V51RD2 MICROcontroller and LCD display.
I’ve established a linear equation for DISTANCE MEASURED and VOLTAGE OUTPUT from the ADC i.e for measurements from 14cm to 21.5cm in steps of 0.5cm (5mm) the sensor gives out a voltage that varies linearly from 45 to 30 controller units in steps of 1 which is basically a negetive slope on when plotted.
Equation: Y= (-5)X + 365
I need a program that would, (1.) use this equation and (2.) display the measured value as a decimal value , if possible as a floating value.
.