Bhuvanesh123
Advanced Member level 4
- Joined
- Aug 29, 2013
- Messages
- 113
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 16
- Location
- Singrauli, India, India
- Activity points
- 814
Code:
void setup()
{
pinMode(15,INPUT);
Serial.begin(9600);
}
void loop()
{
int v=0;
int a=pulseIn(15,LOW);
if(a>2000)
{
for(int i=0;i<12;i++)
{
if(pulseIn(15,LOW)>1000)//doubt is here
{
v=v+(1<<i);
}
}
Serial.println(v);
delay(500);
}
}
This is code for receiving remote signal and converting it to decimal.my protocol is of about 13 bit information. see that (pulseIn(15,LOW)>1000 line.here it receiving 12 bit of data by skipping first start bit.why it is so.