DFRobot DF Bluetooth V3- Working with DFRduino Duemilanove
Описание
Our DF Bluetooth V3 working with our DFRduino. Unfortunately, it does not work with the Arduino UNO because of some resistor conflict in the serial port.
Bluetooth 2.0 Module V3 For Arduino: https://www.dfrobot.com/product-360.html?tracking=5b603d54411d5
DFRduino UNO R3 - Arduino Compatible: https://www.dfrobot.com/product-838.html?tracking=5b603d54411d5
Here is the sample code used:
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
Serial.begin(9600);
Serial.println(" Lets test the bluetooth module");
Serial.println("Press 1 to light the LED, and 2 to turn it off");
Serial.println("Entery: ");
digitalWrite(13, HIGH);
}
void loop() {
if (Serial.available()){
char input = Serial.read();
switch (input){
case '1': //turn led on
digitalWrite(13, HIGH); // set the LED on
delay(100); // wait for a second
Serial.println("it works on!!");
break;
case '2':
digitalWrite(13, LOW); // set the LED off
delay(100); // wait for a second
Serial.println("it works off!!");
break;
}
}
}
Рекомендуемые видео



















