Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: CRC16 FreescaleIAP FreescaleWatchdog GGSProtocol LM75B PIMA Parameters PersistentCircularQueue SerialNumberV2COM mbed-dev-watchdog_2016_03_04
Fork of smartRamalKW by
grandezaInstantanea.cpp
00001 #include "appCommands.h" 00002 #include "sensor.h" 00003 00004 void cmdGrandezaInstantanea(int channel){ 00005 union{ 00006 float measure; 00007 char bytes[4]; 00008 } resp; 00009 00010 switch(channel){ 00011 case 0: // Tensao de Carga 00012 { 00013 int lineChannel = APP_PARAMETERS.LOAD_CHANNEL == 0 ? 1 : 0; 00014 float line = getInstVoltage(lineChannel); 00015 resp.measure = line - getInstVoltage(APP_PARAMETERS.LOAD_CHANNEL); 00016 break; 00017 } 00018 case 1: // Tensao de Linha 00019 resp.measure = getInstVoltage(APP_PARAMETERS.LOAD_CHANNEL == 0 ? 1 : 0); 00020 break; 00021 case 2: // Corrente 00022 resp.measure = getInstCurrent(); 00023 break; 00024 } 00025 00026 exec.enviaResposta(RESP_GRANDEZA_INSTANTANEA, resp.bytes, 4); 00027 }
Generated on Thu Jul 14 2022 00:24:57 by
1.7.2
