pieter Berteloot
/
Project2
k
Fork of m3pi_HelloWorld by
Reveiver.cpp@8:a6afbbc052e2, 2017-04-19 (annotated)
- Committer:
- pietor
- Date:
- Wed Apr 19 09:51:15 2017 +0000
- Revision:
- 8:a6afbbc052e2
k
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pietor | 8:a6afbbc052e2 | 1 | /** |
pietor | 8:a6afbbc052e2 | 2 | Receiver.cpp |
pietor | 8:a6afbbc052e2 | 3 | Purpose: |
pietor | 8:a6afbbc052e2 | 4 | |
pietor | 8:a6afbbc052e2 | 5 | @author Pieter Berteloot |
pietor | 8:a6afbbc052e2 | 6 | */ |
pietor | 8:a6afbbc052e2 | 7 | |
pietor | 8:a6afbbc052e2 | 8 | #include "mbed.h" |
pietor | 8:a6afbbc052e2 | 9 | #include "Receiver.h" |
pietor | 8:a6afbbc052e2 | 10 | |
pietor | 8:a6afbbc052e2 | 11 | Serial pc(USBTX, USBRX); // tx, rx |
pietor | 8:a6afbbc052e2 | 12 | |
pietor | 8:a6afbbc052e2 | 13 | Receiver::Receiver() {}; |
pietor | 8:a6afbbc052e2 | 14 | |
pietor | 8:a6afbbc052e2 | 15 | |
pietor | 8:a6afbbc052e2 | 16 | float Receiver::convertBitsToFloat(char *dataIn) |
pietor | 8:a6afbbc052e2 | 17 | { |
pietor | 8:a6afbbc052e2 | 18 | float temp = (dataIn[0]*1 + dataIn[1]*2 + dataIn[2]*4 + dataIn[3]*8); |
pietor | 8:a6afbbc052e2 | 19 | return temp/16; |
pietor | 8:a6afbbc052e2 | 20 | } |
pietor | 8:a6afbbc052e2 | 21 | |
pietor | 8:a6afbbc052e2 | 22 | |
pietor | 8:a6afbbc052e2 | 23 |