![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Versão limpa em 04/09/2014. Telnet funcionando.
Dependencies: EthernetInterface mbed-rtos mbed NTPClient
Diff: Codes/EventDetector.cpp
- Revision:
- 30:9bf44d2785d5
- Parent:
- 29:fcfcb31a6362
- Child:
- 31:647771325538
diff -r fcfcb31a6362 -r 9bf44d2785d5 Codes/EventDetector.cpp --- a/Codes/EventDetector.cpp Tue Apr 28 14:19:03 2015 +0000 +++ b/Codes/EventDetector.cpp Tue Apr 28 14:38:37 2015 +0000 @@ -102,7 +102,8 @@ if ( ZEROMV ) // verifica se é para retirar o VM { short int buf[NUMBER_OF_SAMPLES]; - int i, newvm = 0; + int i; + float newvm = 0; Capture::CopyBufferSigned(m_Channel,buf); /* Retira o valorMedio de todas as amostras */ @@ -110,9 +111,9 @@ buf[i] -= (int) mv2; newvm += buf[i]; } - if ( m_EventCounter == Settings::get_EventLimit() ){ - newvm /= NUMBER_OF_SAMPLES; - printf("Novo valor medio %d\n", newvm); + if ( m_EventCounter == Settings::get_EventLimit() ){ + newvm = newvm / NUMBER_OF_SAMPLES; + printf("Novo valor medio %.0f\n", newvm); } rmsvalue = SignalProcessor::CalculateRMSSigned(buf, m_Channel);