Page 371 - ARM Based Microcontroller Projects Using MBED
P. 371

14.5 PROJECT 3—ANDROID—NUCLEO BOARD COMMUNICATION USING BLUETOOTH  357
            program. The remainder of the program runs in an endless loop. Inside this loop data (com-
            mands) are received from the Bluetooth device using the scanf function and are stored in char-
            acter array Buffer. The program then controls the LEDs based on these commands, for
            example, ONA turns LEDA ON, ONB turns LEDB ON, OFFA turns OFF LEDA, and OFFB
            turns OFF LEDB.


            14.5.8 Testing the Program

              The program can be tested by using an Android mobile phone to send commands
            through a Bluetooth communication interface. There are many freely available Bluetooth
            communication programs in the Play Store. The one chosen by the author was called the
            Bluetooth Controller by mightyIT (it@memighty.com) as shown in Fig. 14.28. You should


















































            FIG. 14.28  Bluetooth Controller apps.
   366   367   368   369   370   371   372   373   374   375   376