dualchock3_bluetooth_program
Dependencies: mbed SerialMultiByte
main.cpp@3:b2298d306097, 2021-01-23 (annotated)
- Committer:
- LVRhase01
- Date:
- Sat Jan 23 13:04:42 2021 +0000
- Revision:
- 3:b2298d306097
- Parent:
- 1:4975fece403d
changed deta to data.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
LVRhase01 | 0:d4bfc5b1a113 | 1 | #include "mbed.h" |
LVRhase01 | 0:d4bfc5b1a113 | 2 | #include "SerialMultiByte.h" |
LVRhase01 | 0:d4bfc5b1a113 | 3 | |
LVRhase01 | 0:d4bfc5b1a113 | 4 | Serial pc(USBTX, USBRX, 115200); |
LVRhase01 | 0:d4bfc5b1a113 | 5 | SerialMultiByte arduino(PC_12,PD_2); |
LVRhase01 | 0:d4bfc5b1a113 | 6 | |
LVRhase01 | 0:d4bfc5b1a113 | 7 | int main() |
LVRhase01 | 0:d4bfc5b1a113 | 8 | { |
LVRhase01 | 0:d4bfc5b1a113 | 9 | arduino.setHeaders(127,127); |
LVRhase01 | 1:4975fece403d | 10 | arduino.startReceive(8);// |
LVRhase01 | 3:b2298d306097 | 11 | uint8_t data[9]; |
LVRhase01 | 0:d4bfc5b1a113 | 12 | while(true) { |
LVRhase01 | 3:b2298d306097 | 13 | arduino.getData(data); |
LVRhase01 | 1:4975fece403d | 14 | for (uint8_t i = 0; i < 8; i++) { |
LVRhase01 | 3:b2298d306097 | 15 | pc.printf("%d",data[i]); |
LVRhase01 | 0:d4bfc5b1a113 | 16 | pc.printf("\t"); |
LVRhase01 | 0:d4bfc5b1a113 | 17 | } |
LVRhase01 | 0:d4bfc5b1a113 | 18 | pc.printf("\n"); |
LVRhase01 | 0:d4bfc5b1a113 | 19 | } |
LVRhase01 | 0:d4bfc5b1a113 | 20 | } |