Get Started with bluetooth module and arduino

on Sunday, May 31, 2015





Hi everyone,

I am vigneshraja. here i present the code for interfacing arduino with bluetooth module like shown in above video.


Code for command mode control of arduino from phone:


int led = 13;
void setup()
{
  Serial.begin(9600);
 
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW);
}
void loop()
{
 if(Serial.available())
 {
   String value = Serial.readStringUntil('\n');
   Serial.println(value);
   if(value == "on")
   {
     digitalWrite(led,HIGH);
   }
   else if(value == "off")
   {
     digitalWrite(led,LOW);
   }
 
 }
}



code for control arduino by voice from your phone:


int led = 13;
void setup()
{
  Serial.begin(9600);
 
  pinMode(led,OUTPUT);
  digitalWrite(led,LOW);
}
void loop()
{
 if(Serial.available())
 {
   String value = Serial.readStringUntil('\n');
   Serial.println(value);
   if(value == "*hello#")
   {
     digitalWrite(led,HIGH);
   }
   else if(value == "*1#")
   {
     digitalWrite(led,LOW);
   }
 
 }
}



                                                      Thank you for reading

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.