Nadine H. Tuhaimer

Fab Academy 2018 | How to make almost anything






Networking & Communications


I initially intended to use bluetooth hm-11 chip and included it in my board, but I unfortunately I didn't have the time to program it using AT commands. So instead I used a ready HC-05 bluetooth module.


The code I wrote for the bluetooth is quite simple, it just checks if any data is received and compares it using a swtich case code.

        
if (Serial.available()){ // check if data is received { char input=Serial.read(); switch (input){ case '1': // stop the servo pos1=0; pos2=0; break; case '2': // let the servo sweep pos1=170; pos2=180; break; case'3': // turn off strip x=0; y=0; z=0; break; case '4': //light the strip back x = 80; y = 0; z = 125; break; case '5': // Make LED strobe slower intervalLED=30; break; case '6': intervalLED=5; // Make LED strobe faster break; case '7': intervalLED=20; // Make LED strobe medium break; } } }

The above code is part of the full code available in the input & output section of the final project documentation.

The above video shows the communication with the project through an Android Application called Bluetooth Terminal HC-05.

© | 2018. All Rights Reserved.