![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Projectlab Elektronica-ICT KULeuven
Dependencies: EthernetInterface TMP102 TextLCD mbed-rtos mbed
Diff: Frame.cpp
- Revision:
- 4:466d859bfb13
- Parent:
- 3:344115c04cd0
--- a/Frame.cpp Sun Mar 16 18:56:08 2014 +0000 +++ b/Frame.cpp Mon Mar 17 18:40:46 2014 +0000 @@ -58,7 +58,7 @@ printf("IDs %d \n\r",IDs[i]); } } - return CheckCRC(frame); + return CheckCRC(); } int Frame::Encode(char* encode) @@ -129,7 +129,7 @@ } printf("End testEncode\n\r"); } -int Frame::CheckCRC(char* frame) +int Frame::CheckCRC() { if(crc == MakeCRC((char)(12+lengthIDs),(char)IdDestinationMbed,(char)(temperature>>8),(char)temperature,(char)pWMDutycycle,(char* )IDs,lengthIDs)) return 1; @@ -174,9 +174,9 @@ { return (int) (0.026862*temperature-25); } -void Frame::setPWMDutycycle(int pWMDutycycle) +void Frame::setPWMDutycycle(float pWMDutycycle) { - this->pWMDutycycle=pWMDutycycle; + this->pWMDutycycle=(int) (pWMDutycycle*255); } void Frame::setTune(int tune) {