Microcontroller › 8051 › Please help in reading digital output of IR sensor › You can use a
You can use a transistor,
Select a npn transistor, BC548
_______________________________
GND<
|emitter base collector|
> 10k resistor
> VCC
_______________________________
^ |
| |
| |
|_____ output to mcu’s adc
resistor >= 10k
|
|
your Input from
IR sensor
Also you can simulate it in your code, before displaying on the lcd just do it like
255 – value from adc !