Takeuchi Issei
/
Serial_Writer-re
Serial_Writerの受信側
main.cpp@5:029c4cea1114, 2021-05-07 (annotated)
- Committer:
- e2011220
- Date:
- Fri May 07 09:38:59 2021 +0000
- Revision:
- 5:029c4cea1114
- Parent:
- 4:7e5c1416d641
- Child:
- 6:657302a3a908
ts
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
e2011220 | 0:7babc610f171 | 1 | #include "mbed.h" |
e2011220 | 0:7babc610f171 | 2 | #include "Serial_Writer.h" |
e2011220 | 0:7babc610f171 | 3 | Serial_Writer TWE(D5,D4,115200); |
e2011220 | 0:7babc610f171 | 4 | |
e2011220 | 5:029c4cea1114 | 5 | int main(void) |
e2011220 | 5:029c4cea1114 | 6 | { |
e2011220 | 5:029c4cea1114 | 7 | while(true) { |
e2011220 | 4:7e5c1416d641 | 8 | int bit_[3];//送信側と同じ型、同じ要素数の配列 |
e2011220 | 0:7babc610f171 | 9 | int n=TWE.receive(bit_); |
e2011220 | 5:029c4cea1114 | 10 | if(n==0) { |
e2011220 | 3:f0c85f2558c4 | 11 | for(int c:bit_)printf("%d ",c); |
e2011220 | 3:f0c85f2558c4 | 12 | printf("\n\r"); |
e2011220 | 0:7babc610f171 | 13 | } |
e2011220 | 0:7babc610f171 | 14 | } |
e2011220 | 5:029c4cea1114 | 15 | } |