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
main.cpp@1:e856bb79d8b6, 2020-01-14 (annotated)
- Committer:
- Nthnthj
- Date:
- Tue Jan 14 15:45:30 2020 +0000
- Revision:
- 1:e856bb79d8b6
- Parent:
- 0:a7e7666c7a9d
Coucou
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MaxenceGalopin | 0:a7e7666c7a9d | 1 | #include "mbed.h" |
MaxenceGalopin | 0:a7e7666c7a9d | 2 | |
Nthnthj | 1:e856bb79d8b6 | 3 | #define TX PA_9 |
Nthnthj | 1:e856bb79d8b6 | 4 | #define RX PA_10 |
Nthnthj | 1:e856bb79d8b6 | 5 | //#define FilTX PA_2 |
Nthnthj | 1:e856bb79d8b6 | 6 | //#define FilRX PA_3 |
Nthnthj | 1:e856bb79d8b6 | 7 | |
Nthnthj | 1:e856bb79d8b6 | 8 | |
MaxenceGalopin | 0:a7e7666c7a9d | 9 | Serial pc(USBTX, USBRX); |
MaxenceGalopin | 0:a7e7666c7a9d | 10 | |
Nthnthj | 1:e856bb79d8b6 | 11 | Serial BT(TX,RX); |
MaxenceGalopin | 0:a7e7666c7a9d | 12 | |
Nthnthj | 1:e856bb79d8b6 | 13 | //Serial Fil(FilTX, FilRX); |
MaxenceGalopin | 0:a7e7666c7a9d | 14 | |
Nthnthj | 1:e856bb79d8b6 | 15 | //DigitalOut LEDA(PB_8,0); |
Nthnthj | 1:e856bb79d8b6 | 16 | //DigitalOut LEDB(PB_9,0); |
MaxenceGalopin | 0:a7e7666c7a9d | 17 | |
MaxenceGalopin | 0:a7e7666c7a9d | 18 | int main() |
MaxenceGalopin | 0:a7e7666c7a9d | 19 | { |
Nthnthj | 1:e856bb79d8b6 | 20 | //char c; |
MaxenceGalopin | 0:a7e7666c7a9d | 21 | char Buffer[10]; |
Nthnthj | 1:e856bb79d8b6 | 22 | char Buffer2[10]; |
MaxenceGalopin | 0:a7e7666c7a9d | 23 | |
MaxenceGalopin | 0:a7e7666c7a9d | 24 | while(1) { |
Nthnthj | 1:e856bb79d8b6 | 25 | if(BT.readable()){ |
Nthnthj | 1:e856bb79d8b6 | 26 | BT.scanf("%s",&Buffer); |
Nthnthj | 1:e856bb79d8b6 | 27 | pc.printf(Buffer); |
Nthnthj | 1:e856bb79d8b6 | 28 | pc.puts(Buffer); |
Nthnthj | 1:e856bb79d8b6 | 29 | //c = pc.getc(); |
Nthnthj | 1:e856bb79d8b6 | 30 | //pc.printf(Buffer2); |
MaxenceGalopin | 0:a7e7666c7a9d | 31 | } |
Nthnthj | 1:e856bb79d8b6 | 32 | if(pc.readable()){ |
Nthnthj | 1:e856bb79d8b6 | 33 | pc.scanf("%s", &Buffer2); |
Nthnthj | 1:e856bb79d8b6 | 34 | BT.printf(Buffer2); |
Nthnthj | 1:e856bb79d8b6 | 35 | BT.puts(Buffer2); |
Nthnthj | 1:e856bb79d8b6 | 36 | |
Nthnthj | 1:e856bb79d8b6 | 37 | } |
Nthnthj | 1:e856bb79d8b6 | 38 | //BT.puts("coucou"); |
Nthnthj | 1:e856bb79d8b6 | 39 | //pc.puts("Hello_test"); |
Nthnthj | 1:e856bb79d8b6 | 40 | |
MaxenceGalopin | 0:a7e7666c7a9d | 41 | } |
MaxenceGalopin | 0:a7e7666c7a9d | 42 | } |