Closed motters closed 7 years ago
// get voltage bits
double voltage = data.at(9).toInt() + (data.at(10).toInt()*256);
// Un calibrated voltage
double voltageUncal = ( voltage / 65536) * 2.44;
// Find cal voltage
double slope = 3.7231E-05;
double offset = 0.0000E+00;
double voltageCal = ( slope * voltage ) + offset;
// Compare the voltages
qDebug() << voltage << "; rought voltage: " << voltageUncal << " Accurate voltage: " << voltageCal;
Created a command constructer to cover the above and other HALs
qDebug() << "Config IO"; m_command.insert("FIO7", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("FIO6", "1"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("FIO5", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("FIO4", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO7", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO6", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO5", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO4", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO3", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO2", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO1", "0"); // 1 = Analgue Input; 0 = Digital IO m_command.insert("EIO0", "0"); // 1 = Analgue Input; 0 = Digital IO configureIO();