Difference between revisions of "Bluetooth Application Guide"

From Flowcode Help
Jump to navigationJump to search
Line 55: Line 55:
 
is available for use as a serial device. Once this has been done the Bluetooth module will       
 
is available for use as a serial device. Once this has been done the Bluetooth module will       
 
recover these settings every time it is powered on or until it is reprogrammed.
 
recover these settings every time it is powered on or until it is reprogrammed.
 +
 +
In examples 2 and 3 use the RS232 component to communicate over the
 +
Bluetooth serial connection. The RS232 component and the Bluetooth component both use the
 +
hardware UART so only one of the components can be connected to a single program.

Revision as of 13:58, 29 August 2014

Introduction

These examples demonstrate the use of the Flowcode Bluetooth component.

In particular they make use of the EB024 E-blocks Bluetooth board, connected to an EB006 E-blocks PICmicro multiprogrammer fitted with a 16F1937 microprocessor.

However, the examples are easily changed in Flowcode to support other microprocessors and platforms.

The Matrix TSL EB934SI6 Easy Bluetooth bundle has all the items required for these sample applications and is an ideal introduction to Bluetooth technology.

Setting up the project hardware

Connect the E-Blocks as indicated in the table below.

The Bluetooth, LCD and Switch E-Blocks all need to be powered via wire connections to the +V on the EB006.

Hardware Setup
EB006 PICmicro multiprogrammer
EB004 E-blocks LED board Port A
EB005 E-blocks LCD board Port B
EB024 E-blocks Bluetooth board Port C
EB007 E-blocks push-to-make switch board Port D

Example 1: Discoverable serial device

FC6 Icon.png Discoverable Serial Device Setup Example

Example 1 is a simple program that sets up the Bluetooth module by using a script to setup the module as a generic serial communications bus. Once the device has been setup the LCD will display the message OK. When a pair request is received from another Bluetooth device the MAC address of this device is shown on the LCD.

Once the Bluetooth device has been setup to be discoverable and a pairing key has been assigned, this information is stored into the firmware of the Bluetooth module using the AT&w command. For example 1 we show you how to set up these details so that your Bluetooth board is available for use as a serial device. Once this has been done the Bluetooth module will recover these settings every time it is powered on or until it is reprogrammed.

In examples 2 and 3 use the RS232 component to communicate over the Bluetooth serial connection. The RS232 component and the Bluetooth component both use the hardware UART so only one of the components can be connected to a single program.