/* void sendCoefThroughUART(void) { signed int AC1, AC2, AC3, AC4, AC5, AC6, B1, B2, MB, MC, MD; AC1 = coefficients(BMP085_CAL_AC1); IntToStr(AC1, data_); UART1_Write_Text(data_); UART1_Write(' '); AC2 = coefficients(BMP085_CAL_AC2); IntToStr(AC2, data_); UART1_Write_Text(data_); UART1_Write(' '); return; } */ void main() { genericInit(); I2C1_Init(100000); // Initiate I2C @ 100 kHz initMPU6050(); //CallibrateMPU6050raw(); // Measures the offset values of both accelerometer and gyroscope initHMC5883L(); /* initTimer0(); startTimer0(); Delay_ms(1000); // Maximum allowable time stopTimer0(); */ Delay_ms(100); // Wait for UART module to stabilize while(1) { do {} while(UART1_Read() != 's'); // Wait until start signal is received do { readAccMPU6050(); readGyrMPU6050(); readTmpMPU6050(); readUTBMP085(); readUPBMP085(); readHMC5883Lraw(); sendThroughUARTtoMSVS(); //Delay_ms(1000); } while(UART1_Read() != 'e'); // Do until end signal is received }//while return; }
boolean IMU::init(int aPinBuzzer){ pinBuzzer = aPinBuzzer; loadCalib(); printCalib(); if (!initL3G4200D()) return false; initADXL345B(); initHMC5883L(); now = 0; hardwareInitialized = true; return true; }