I like arduino because it has almost limitless potential. One of few a things that I hate is that when you want to control the arduino it has to be connected directly to the PC via USB.
Next tricky thing is connecting arduino to PC. Your PC has to have some Bluetooth device that supports Bluetooth serial port communication. Then upload this sketch to arduino :
const int ledPin = 13;
int value;
void setup() {
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
if (Serial.available() > 0) {
value = Serial.read();
if (value == 'H') {
digitalWrite(ledPin, HIGH);
Serial.println("ON");
}
if (value == 'L') {
digitalWrite(ledPin, LOW);
Serial.println("OFF");
}
}
}
Then unplug arduino from PC and put in 9V battery. Search for Bluetooth devices and you should find your device (mine is called WIDE_HK) select pair and then connect. Then just turn on some terminal app (puTTy, Arduino IDE….) connect it to serial port of your Bluetooth device and send it H to turn it ON or L to turn it OFF.
Video :
No comments:
Post a Comment