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.
main.cpp@5:47575b30c19a, 2016-02-04 (annotated)
- Committer:
- Kio_Liex
- Date:
- Thu Feb 04 20:18:39 2016 +0000
- Revision:
- 5:47575b30c19a
- Parent:
- 4:9c0216df5c8e
- Child:
- 7:d8f4e9d92ab5
BlueTooth HC-05 module running on a ST-Nucleo-F303K8
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| screamer | 0:005629fe3609 | 1 | #include "mbed.h" | 
| Kio_Liex | 5:47575b30c19a | 2 | #include "HC05.h" | 
| Kio_Liex | 4:9c0216df5c8e | 3 | |
| Kio_Liex | 4:9c0216df5c8e | 4 | DigitalOut myLed(LED1); | 
| Kio_Liex | 4:9c0216df5c8e | 5 | |
| Kio_Liex | 4:9c0216df5c8e | 6 | Serial pc(USBTX, USBRX); // tx, rx | 
| Kio_Liex | 4:9c0216df5c8e | 7 | |
| Kio_Liex | 5:47575b30c19a | 8 | HC05 myBT(D1, D0); // tx, rx | 
| Kio_Liex | 4:9c0216df5c8e | 9 | |
| Kio_Liex | 5:47575b30c19a | 10 | int16_t xVal=0, yVal=0, cVal=0; | 
| screamer | 0:005629fe3609 | 11 | |
| Kio_Liex | 5:47575b30c19a | 12 | int main() | 
| Kio_Liex | 5:47575b30c19a | 13 | { | 
| Kio_Liex | 4:9c0216df5c8e | 14 | pc.baud(115200); | 
| Kio_Liex | 4:9c0216df5c8e | 15 | pc.printf("\r\n -= Serial Bluetooth test \r\n"); | 
| Kio_Liex | 4:9c0216df5c8e | 16 | |
| Kio_Liex | 5:47575b30c19a | 17 | while(1) | 
| Kio_Liex | 5:47575b30c19a | 18 | { | 
| Kio_Liex | 5:47575b30c19a | 19 | myBT.getValue(&xVal, &yVal, &cVal); | 
| Kio_Liex | 4:9c0216df5c8e | 20 | |
| Kio_Liex | 5:47575b30c19a | 21 | if(xVal || yVal || cVal > 0) | 
| Kio_Liex | 4:9c0216df5c8e | 22 | { | 
| Kio_Liex | 4:9c0216df5c8e | 23 | pc.printf("X= %d, Y= %d, C= %d \r\n",xVal, yVal, cVal); | 
| Kio_Liex | 4:9c0216df5c8e | 24 | } | 
| Kio_Liex | 4:9c0216df5c8e | 25 | |
| Kio_Liex | 4:9c0216df5c8e | 26 | myLed = !myLed; | 
| screamer | 0:005629fe3609 | 27 | } | 
| screamer | 0:005629fe3609 | 28 | } |