Skip to content

Instantly share code, notes, and snippets.

@ochilab
Created March 1, 2015 13:53
Bluetooth Shield SLD63030PをSlaveモードで動かす
void setupBlueToothConnection(){
blueToothSerial.begin(38400); //Set BluetoothBee BaudRate to default baud rate 38400
blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
delay(2000); // This delay is required.
blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable
Serial.print("The slave bluetooth is inquirable!");
delay(2000); // This delay is required.
blueToothSerial.flush();
}
void loop() {
int sensorValue = analogRead(A0);
blueToothSerial.print(sensorValue);
blueToothSerial.print("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment