![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Serial_Writerの受信側
main.cpp@0:7babc610f171, 2021-05-07 (annotated)
- Committer:
- e2011220
- Date:
- Fri May 07 08:56:25 2021 +0000
- Revision:
- 0:7babc610f171
- Child:
- 3:f0c85f2558c4
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 | 0:7babc610f171 | 7 | int bit_[3]; |
e2011220 | 0:7babc610f171 | 8 | int n=TWE.receive(bit_); |
e2011220 | 0:7babc610f171 | 9 | if(n==0){ |
e2011220 | 0:7babc610f171 | 10 | printf("%d %d %d\n\r",bit_[0],bit_[1],bit_[2]); |
e2011220 | 0:7babc610f171 | 11 | } |
e2011220 | 0:7babc610f171 | 12 | } |
e2011220 | 0:7babc610f171 | 13 | } |