Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-src MODSERIAL
Revision 5:73ac83c240ec, committed 2014-08-12
- Comitter:
- edodm85
- Date:
- Tue Aug 12 16:16:02 2014 +0000
- Parent:
- 4:54c1dc468534
- Child:
- 6:2a90ddc8282b
- Commit message:
- Added support for LPC4330
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Aug 12 16:11:43 2014 +0000
+++ b/main.cpp Tue Aug 12 16:16:02 2014 +0000
@@ -1,6 +1,6 @@
/*
* Author: Edoardo De Marchi
- * Date: 02-07-13
+ * Date: 12-08-14
* Notes: HC05 AT command
*/
@@ -8,17 +8,19 @@
#include "MODSERIAL.h"
-#define SERIAL_1
-
-#ifdef SERIAL_1
-MODSERIAL blue(p9,p10); // HC05
-#endif
-#ifdef SERIAL_2
-MODSERIAL blue(p13,p14); // HC05
-#endif
MODSERIAL pc(USBTX, USBRX);
DigitalOut led1(LED1);
-DigitalOut led4(LED4);
+
+
+#if defined(TARGET_LPC1768)
+MODSERIAL blue(p9, p10); // TX = P9 RX = P10
+//MODSERIAL blue(p13, p14); // TX = P13 RX = P14
+#elif defined(TARGET_LPC4330_M4)
+MODSERIAL blue(UART0_TX, UART0_RX); // P6_4, P6_5
+//MODSERIAL blue(UART3_TX, UART3_RX); // P2_3, P2_4
+#endif
+
+
bool new_send = false;
@@ -63,6 +65,7 @@
pc.attach(&rxPcCallback, MODSERIAL::RxIrq);
pc.printf("AT Mode Start\r\n");
+ int i = 0;
while(1)
{
@@ -92,5 +95,11 @@
new_response = false;
}
wait_ms(100);
+ i++;
+ if(i == 5)
+ {
+ led1 = !led1;
+ i=0;
+ }
}
}
\ No newline at end of file
Bluetooth HC-05