Devices & Components
Arduino Uno Rev3
SparkFun Bluetooth Modem - BlueSMiRF Silver
Software & Tools
Arduino IDE
Project description
Code
arduino sketch
arduino
upload the sketch into your arduino board
1 2char junk; 3String inputString=""; 4 5void setup() 6{ 7 Serial.begin(9600); 8 pinMode(13, OUTPUT); 9pinMode(10,OUTPUT); 10pinMode(7,OUTPUT); 11} 12 13void loop() 14{ 15 if(Serial.available()){ 16 while(Serial.available()) 17 { 18 char inChar = (char)Serial.read(); 19 inputString += inChar; 20 } 21 Serial.println(inputString); 22 while (Serial.available() > 0) 23 { 24 junk = Serial.read() ; 25} 26 if(inputString == "a") 27{ 28 digitalWrite(13, HIGH); 29 } 30else if(inputString == "b") 31{ 32 digitalWrite(10, HIGH); 33 } 34else if(inputString == "c") 35{ 36 digitalWrite(7, HIGH); 37 } 38else if(inputString == "x") 39{ 40 digitalWrite(10, LOW); 41 digitalWrite(13, LOW); 42 digitalWrite(7, LOW); 43 } 44 inputString = ""; 45 } 46} 47
Downloadable files
Circuit diagram
connect the arduino and Bluetooth module as show in the picture
Circuit diagram

Circuit diagram
connect the arduino and Bluetooth module as show in the picture
Circuit diagram

Comments
Only logged in users can leave comments