예제7) 블루투스 모듈 이름 변경

Dependencies:   mbed-src

Fork of HC-05_S2B_HelloWorld_WIZwiki-W7500 by WIZnet

Files at this revision

API Documentation at this revision

Comitter:
robertchoi
Date:
Tue Oct 17 04:08:56 2017 +0000
Parent:
0:a4c1f76c9564
Commit message:
??7) ???? ?? ?? ??

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
diff -r a4c1f76c9564 -r b976dec64b41 main.cpp
--- a/main.cpp	Wed Jul 01 03:23:26 2015 +0000
+++ b/main.cpp	Tue Oct 17 04:08:56 2017 +0000
@@ -1,37 +1,14 @@
-/**
- ******************************************************************************
- * @project HC-05_HelloWorld_WIZwiki-W7500
- * @author  WIZnet
- * @version V1.0.0
- * @date    01-JUL-2015
- * @brief   Main program
-*******************************************************************************
-**/
-
-/* Includes ------------------------------------------------------------------*/
 #include "mbed.h"
 
-/* Private typedef -----------------------------------------------------------*/
-/* Private define ------------------------------------------------------------*/
-/* Private variables ---------------------------------------------------------*/
 Serial pc(USBTX, USBRX);
-Serial bt(PA_14, PA_13);
+Serial bt(D1, D0);
 
-/* Private function prototypes -----------------------------------------------*/
-
-/* Private functions ---------------------------------------------------------*/
-/**
-   * @brief  Main Function
-   * @param  None
-   * @retval None
-   */
 int main(void)
 {
     char ch;
-    pc.baud(115200);
-    bt.baud(115200);
-    pc.printf("Hello World!\n\r");
-    bt.printf("Hello World!\r\n");
+    pc.baud(9600);
+    bt.baud(9600);
+    pc.printf("Hello World! HC-06 bluetooth example...\n\r");
     
     while(1)
     {
@@ -39,14 +16,12 @@
         {
             ch=bt.getc();
             pc.printf("%c",ch);
-            bt.printf("%c",ch);
         }
         
         else if(pc.readable())
         {
             ch=pc.getc();
             bt.printf("%c",ch);
-            pc.printf("%c",ch); 
         }
     }
 }
diff -r a4c1f76c9564 -r b976dec64b41 mbed-src.lib
--- a/mbed-src.lib	Wed Jul 01 03:23:26 2015 +0000
+++ b/mbed-src.lib	Tue Oct 17 04:08:56 2017 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed-src/#99a3d3d9c43f
+http://mbed.org/users/mbed_official/code/mbed-src/#a11c0372f0ba