Devices & Components
Arduino Uno Rev3
Bluetooth Low Energy (BLE) Module (Generic)
Software & Tools
BlueMix
Project description
Code
Code for BLuetooth sensor HC-05
text
1void setup() { 2Serial.begin(9600); 3 pinMode(8, OUTPUT); // put your setup code here, to run once: 4 } 5 6void loop() { 7 // put your main code here, to run repeatedly: 8 if(Serial.available()>0) 9 { 10 char data= Serial.read(); // reading the data received from the bluetooth module 11 switch(data) 12 { 13 case 'a': digitalWrite(8, HIGH);break; // when a is pressed on the app on your smart phone 14 case 'd': digitalWrite(8, LOW);break; // when d is pressed on the app on your smart phone 15 default : break; 16 } 17 Serial.println(data); 18 } 19 delay(50); 20}
Downloadable files
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
Documentation
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
BLUETOOTH CONTROLLED LEDs
Comments
Only logged in users can leave comments