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@7:d8f4e9d92ab5, 2016-02-04 (annotated)
- Committer:
- Kio_Liex
- Date:
- Thu Feb 04 21:25:05 2016 +0000
- Revision:
- 7:d8f4e9d92ab5
- Parent:
- 5:47575b30c19a
Minor change.
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 | 7:d8f4e9d92ab5 | 19 | if(myBT.getValue(&xVal, &yVal, &cVal)) |
| Kio_Liex | 4:9c0216df5c8e | 20 | { |
| Kio_Liex | 4:9c0216df5c8e | 21 | pc.printf("X= %d, Y= %d, C= %d \r\n",xVal, yVal, cVal); |
| Kio_Liex | 4:9c0216df5c8e | 22 | } |
| Kio_Liex | 4:9c0216df5c8e | 23 | |
| Kio_Liex | 4:9c0216df5c8e | 24 | myLed = !myLed; |
| screamer | 0:005629fe3609 | 25 | } |
| screamer | 0:005629fe3609 | 26 | } |