mjendza / arduino

0 stars 0 forks source link

HC-06 #13

Closed mjendza closed 9 years ago

mjendza commented 9 years ago
mjendza commented 9 years ago

http://www.arduino.cc/en/Reference/SoftwareSerial

AT commands: PIN: AT+PIN6789 DevName: AT+NAMEdevName

http://www.instructables.com/files/orig/FKY/Z0UT/HX7OYY7I/FKYZ0UTHX7OYY7I.pdf

mjendza commented 9 years ago

void loop() // run over and over {

while (!mySerial.available()); // stay here so long as COM port is empty delay(2000); mySerial.print("AT+NAMEXX_XX"); delay(2000); mySerial.print("AT+PIN1111"); delay(2000); receivedChar = mySerial.read(); if (receivedChar == '1') { digitalWrite(LED, HIGH); }// if it's a 1 turn LED on if (receivedChar == '2') { digitalWrite(LED, LOW); } // if it's a 2 turn LED off

}

this code works, we should reset arduino after we put the code into the device