Fan Control Demo

Dependencies:   mbed-rtos mbed

Fork of mbed_fota by KIM HyoengJun

Committer:
dudnwjs
Date:
Wed Jun 24 08:50:07 2015 +0000
Revision:
4:60be78a172c2
Parent:
3:1e70387e1337
Child:
5:e11b23f9aacc
Add advertising feature;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dudnwjs 0:a1f6b1ba8a1e 1 #include "mbed.h"
dudnwjs 1:5cf3a6c969be 2 #include "BleMsgHandler.h"
dudnwjs 3:1e70387e1337 3 #include "app.h"
dudnwjs 0:a1f6b1ba8a1e 4
dudnwjs 0:a1f6b1ba8a1e 5 Serial hostpc(USBTX,USBRX);
dudnwjs 0:a1f6b1ba8a1e 6 Serial device(p13,p14);
dudnwjs 0:a1f6b1ba8a1e 7
dudnwjs 0:a1f6b1ba8a1e 8 DigitalOut myled(LED1);
dudnwjs 0:a1f6b1ba8a1e 9
dudnwjs 1:5cf3a6c969be 10 using namespace sevencore_fota;
dudnwjs 1:5cf3a6c969be 11
dudnwjs 0:a1f6b1ba8a1e 12 int main() {
dudnwjs 3:1e70387e1337 13 device.baud(115200);
dudnwjs 3:1e70387e1337 14
dudnwjs 1:5cf3a6c969be 15 BleMsgHandler myfota(&device,&hostpc);
dudnwjs 0:a1f6b1ba8a1e 16
dudnwjs 1:5cf3a6c969be 17 myfota.PrintTitle();
dudnwjs 0:a1f6b1ba8a1e 18
dudnwjs 3:1e70387e1337 19 app_rst_gap(&myfota);
dudnwjs 3:1e70387e1337 20
dudnwjs 4:60be78a172c2 21 for(int i = 0; i < 10; i++)
dudnwjs 4:60be78a172c2 22 {
dudnwjs 4:60be78a172c2 23 myfota.BleReceiveMsg();
dudnwjs 4:60be78a172c2 24 myfota.BleMsgHandle();
dudnwjs 4:60be78a172c2 25 }
dudnwjs 3:1e70387e1337 26
dudnwjs 0:a1f6b1ba8a1e 27
dudnwjs 0:a1f6b1ba8a1e 28 while(1) {
dudnwjs 0:a1f6b1ba8a1e 29 myled = 1;
dudnwjs 0:a1f6b1ba8a1e 30 wait(0.5);
dudnwjs 0:a1f6b1ba8a1e 31 myled = 0;
dudnwjs 0:a1f6b1ba8a1e 32 wait(0.5);
dudnwjs 0:a1f6b1ba8a1e 33 }
dudnwjs 0:a1f6b1ba8a1e 34 }