bool Hal::initHal() { debugPrintLn("Start init"); // initialize all the hardware initLora(); initSwitch(); initLTC(); compass.init(); compass.enableDefault(); htu.begin(); // setAckOn(); debugPrintLn("Einde init"); }
int16_t main(void) { //TODO discharge calculations int i = LTC3; int j; char voltages[19]; int selfCheck = 0; configPins(); configClock(); //Comment out next 5 lines if debugging selfCheck += initLTC(); selfCheck += initADC();//initADC(); if(selfCheck == 2){ setRelay(RELAY_ON); } while(1) { //comment out next 4 lines if debugging for(i = LTC1; i < LTC_ALL; i++){ LTC_readVoltages(i); } checkADC(); //uncomment next 0 lines if debugging RS-485 //unComment next 3 lines if debugging LTC //LTC_writeConfig(LTC_ALL, 0); //LTC_readVoltages(i); //LTC_analyzeVolts(i); //uncomment out next 3 lines if debugging ADC // j = ADCReadRaw(TEMP1_CHANNEL); // j++; // j--; } }