program of remote control

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
bhuvaneshnick
 
Posts: 20
Joined: Wed Jan 01, 2014 1:23 am

program of remote control

Post by bhuvaneshnick »

Code: Select all

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”