Ohnishi_Gundan / Mbed 2 deprecated Master-FM

Dependencies:   MODSERIAL mbed-rtos mbed

Fork of Master by Ohnishi_Gundan

main.cpp

Committer:
9uS7
Date:
2014-09-11
Revision:
1:e1cfb5850088
Parent:
0:4f07ba929908
Child:
2:c610e1a7fbcd

File content as of revision 1:e1cfb5850088:

//Master mbed Program

#include "mbed.h"
#include "fm.h"
#include "bluetooth.h"
#include "control.h"

//BT_MASTER or BT_SLAVE
#define DEVICE_ROLE BT_MASTER

Serial pc(USBTX, USBRX);   // tx, rx
 
//debug
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led4(LED4);
 
DigitalOut myled1(LED1);
DigitalOut myled2(LED2);

//byte converter
Cvt cvt;

void btRead(void);

int main()
{
    //FM_FREQUENCY is defined in fm.h
    unsigned int fm_frequency = DEVICE_ROLE==BT_MASTER ? FM_FREQUENCY1 : FM_FREQUENCY2;
    
    i2cSetup( fm_frequency );
    btSetup(DEVICE_ROLE);
    while(1){
        /*i2c.start();
        i2c.write(0x11);
        i2c.write(0x42);
        i2c.write(0x07);
        i2c.write(0x0F);
        i2c.stop();
        wait(0.05);*/
    }
 }