Comms Library for communicating via bluetooth

Dependents:   EHWM

Embed: (wiki syntax)

« Back to documentation index

Comms Class Reference

Comms Class Reference

Class library to create a serial connection from the MCU to the bluetooth device. More...

#include <Comms.h>

Public Member Functions

 Comms (PinName TX, PinName RX)
 Create a serial connection from the MCU to the bluetooth device.

Data Fields

float data
 changing the boolen variable to false.
char cmd [50]
 Character string for storing the direction.
bool newmsg
 boolean variable to state if there is a new message or not.

Detailed Description

Class library to create a serial connection from the MCU to the bluetooth device.

Example:

 #include "mbed.h"
 *#include "Comms.h"

 *Comms BT(PC_6, PC_7);

 *int main() 
 *{
    while(1) 
    {   
        if(BT.newmsg == true)
        {                                  
            BT.printf("%s\n",BT.cmd);
            BT. printf("%.2f\n", BT.data);
            BT.clrmsg();
        }
        
    }
 *}

Definition at line 55 of file Comms.h.


Constructor & Destructor Documentation

Comms ( PinName  TX,
PinName  RX 
)

Create a serial connection from the MCU to the bluetooth device.

Parameters:
TXPin for transmitting data.
RXPin for Receiving data.

Definition at line 4 of file Comms.cpp.


Field Documentation

char cmd[50]

Character string for storing the direction.

Parameters:
None

Definition at line 79 of file Comms.h.

float data

changing the boolen variable to false.

Parameters:
Nonefloat variable for storing the speed value.
None

Definition at line 73 of file Comms.h.

bool newmsg

boolean variable to state if there is a new message or not.

Parameters:
None

Definition at line 85 of file Comms.h.