Takeuchi Issei
/
Serial_Writer-re
Serial_Writerの受信側
main.cpp@4:7e5c1416d641, 2021-05-07 (annotated)
- Committer:
- e2011220
- Date:
- Fri May 07 09:36:29 2021 +0000
- Revision:
- 4:7e5c1416d641
- Parent:
- 3:f0c85f2558c4
- Child:
- 5:029c4cea1114
fs
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 | 0:7babc610f171 | 5 | int main(void){ |
e2011220 | 0:7babc610f171 | 6 | while(true){ |
e2011220 | 4:7e5c1416d641 | 7 | int bit_[3];//送信側と同じ型、同じ要素数の配列 |
e2011220 | 0:7babc610f171 | 8 | int n=TWE.receive(bit_); |
e2011220 | 0:7babc610f171 | 9 | if(n==0){ |
e2011220 | 3:f0c85f2558c4 | 10 | for(int c:bit_)printf("%d ",c); |
e2011220 | 3:f0c85f2558c4 | 11 | printf("\n\r"); |
e2011220 | 0:7babc610f171 | 12 | } |
e2011220 | 0:7babc610f171 | 13 | } |
e2011220 | 0:7babc610f171 | 14 | } |