int main(int argc,char** argv) { if(strcmp(argv[1],"--help")==0||strcmp(argv[1],"-h")==0){ printf("Command:\n-h --help print command\n-calc use calc and exit\n"); } else if(strcmp(argv[1],"-calc")==0){ char virogenie[SIZE]; Node *stack; initALL(&stack); Node *postFix; initALL(&postFix); Simvol result; fgets(virogenie,SIZE,stdin); toPostfix(&postFix,virogenie,&stack); dellList(&stack); //gogoPostfix(&postFix,&stack); chekTop(&result,stack); dellList(&stack); dellList(&postFix); printf("%.3f\n",result.numb); } return 0; }
int main(void) { int rectimetemp, adc2, adc3, bat, i, accx, accy, accz; float temp=0; accx=accy=accz=adc2=bat=adc3=0; uint8_t receivedflag, j=0; Broentech_Package_Header header; initALL(); // Initialize all the peripherals /* Check I2C device and tell me who is connected and who is not for (j=0; j<255; j+=2){ for (i=0; i<1000; i++); //Delay if(I2C_check_dev(I2C2, j)==SUCCESS) printf("device %d ok \n\r", j); } for (i=0; i<100000; i++); //Delay printf("Initialization Status: Ok, Devices checked! \n\r"); //Send string over USART1 for (i=0; i<1000000; i++); //Delay */ while(1) { //wakeup_RF(); // Wake up the RF chip /*read ADC values*/ bat=(3*readADCbat()); //read battery value temp=read_temp(); // adc3=readADC3(); //read ADC3 Sensors // adc2=readADC2(); //read ADC2 Sensor sendDatagramfloat(temp, 0.0, 0.0); // sendDatagramint(adc2,0,0); // sendDatagramint(adc3,0,0); //build header and sent datagram for bat memcpy(&header.sensID, "BATT",4); memcpy(&header.dataType, "AINT",4); memcpy(&header.dataID, "B---",4); sendDatagramint(header,bat,0,0); temp=0.0; bat=adc3=adc2=0; //go to sleep //sleep_RF(); PWR_EnterSleepMode(PWR_Regulator_LowPower, PWR_SLEEPEntry_WFI); } }