We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have use following code for 8051 by NXP(p89v51rd2)
#include<reg51.h> #define p2 P2 sfr P1=0x90; sbit led1=p2^0; sbit s=P1^0; void main() { s=1; while(1) { if(s==0) { led1=1; } else { led1=0; } } }
I have connected led on port 2 (pin no. 0) circuit of sensor is here elecrom.wordpress.com/.../
this sensor on black background generate 0 to 1.5 Volt
when i connect ground to port 1 via 1k led glow but when i give output from sensor (IR sensor) output volt of sensor increase to 5V. Is there something wrong with program?