suriya prakash
Published

tiny85 with ir sensor

Hai everyone this is suriya. here im try to build a simple project using ir sensor and attiny85 ic.

BeginnerWork in progress1 hour27
tiny85 with ir sensor

Story

Read more

Custom parts and enclosures

working video

Code

code

C/C++
int ir = 3;
int irled = 4;


void setup()
{
  pinMode(ir,INPUT);
  pinMode(irled,OUTPUT);
}
void loop()
{
  irsen();
}

int irsen()
{
  int irstatus = digitalRead(ir);
  if(irstatus==1)
  {
    digitalWrite(irled,LOW);
  }
  else
  {
    digitalWrite(irled,HIGH);
  }
  }

Credits

suriya prakash
2 projects • 2 followers
Contact

Comments

Please log in or sign up to comment.