program of remote control

Thread Starter

bhuvanesh

Joined Aug 10, 2013
268
Rich (BB 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);
  }
}
code of arduino.
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.
 
Top