Dark detector using low power MSP430

on Sunday, February 22, 2015








circuit diagram:







coding:

int led = P1_6;
void setup()
{
pinMode(led,OUTPUT);
digitalWrite(led,LOW);
}

void loop()
{
  int ldr = analogRead(A5);
  if(ldr < 10)
  {
  digitalWrite(led,HIGH);
  }
  else
  {
   digitalWrite(led,LOW);
  }
}



                                 Thank you for reading.