BLUETOOTH MODULE

TINKS039

  1. The Bluetooth module can use to connect a serial port connection between MCU and GPS, PC to your embedded project, etc.
  2. Here we use HC-05 module.
Features:-
  1. Low Power 1.8V Operation, 1.8 to 3.6V I/O
  2. UART (Universal Asynchronous Receiver/Transmitter) interface with programmable baud rate.
  3. With integrated antenna
  4. With edge connector.
  5. Auto-connect to the last device on power as default.
  6. Permit pairing device to connect as default.
  7. Auto-pairing PINCODE:”0000” as default
  8. Auto-reconnect in 30 min when disconnected as a result of beyond the range of connection.
Applications:-
  1. Automatic synchronization
  2. game controllers
  3. Cordless Desktop etc.
  4. Wireless communication between two microcontrollers
  5. Communicate with Laptop, Desktops and mobile phones
  6. Data Logging application
  7. Consumer applications
  8. Wireless Robots
  9. Home Automation

    

int state = 0;

void setup() {
Serial.begin(9600); // Default communication rate of the Bluetooth module
}

void loop() {
if(Serial.available() > 0){ // Checks whether data is comming from the serial port
state = Serial.read(); // Reads the data from the serial port
Serial.println(state);
if(state==48)
Serial.println("Type 0");
else if(state==49)
Serial.println("type 1");
else
Serial.println(state);
}
}