Conect Matlab with MBED FRDM-KL25Z serial
Dependencies: FastAnalogIn mbed
Fork of Matlab2013serialKL25Z by
main.cpp@2:7942a82c8561, 2014-10-25 (annotated)
- Committer:
- kklokeshkumar
- Date:
- Sat Oct 25 09:02:46 2014 +0000
- Revision:
- 2:7942a82c8561
- Parent:
- 0:cdcf435b31f9
jkih
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
oscargrodri | 0:cdcf435b31f9 | 1 | #include "mbed.h" |
kklokeshkumar | 2:7942a82c8561 | 2 | |
oscargrodri | 0:cdcf435b31f9 | 3 | |
oscargrodri | 0:cdcf435b31f9 | 4 | Serial pc(USBTX, USBRX); |
oscargrodri | 0:cdcf435b31f9 | 5 | |
oscargrodri | 0:cdcf435b31f9 | 6 | AnalogIn ain(PTB0); |
oscargrodri | 0:cdcf435b31f9 | 7 | |
oscargrodri | 0:cdcf435b31f9 | 8 | int main() |
oscargrodri | 0:cdcf435b31f9 | 9 | { |
oscargrodri | 0:cdcf435b31f9 | 10 | while(true) { |
kklokeshkumar | 2:7942a82c8561 | 11 | pc.printf(" %f ",(float)(ain.read_u16() * 0.000050355)); |
oscargrodri | 0:cdcf435b31f9 | 12 | wait(.1); |
oscargrodri | 0:cdcf435b31f9 | 13 | } |
oscargrodri | 0:cdcf435b31f9 | 14 | } |
oscargrodri | 0:cdcf435b31f9 | 15 |