Ejemplo n.º 1
0
	virtual void keepTemperature() {
		if (getCurrentTemperature() > this->temperature) {
			this->cooler->turnOn();
		} else {
			this->cooler->turnOff();
		}
	}
Ejemplo n.º 2
0
void Thermostat::process() {
    float temperature = getCurrentTemperature();

    bool changed = changeState(temperature);
    if (changed) {
        if (controlPin != -1)
            digitalWrite(controlPin, state == RUNNING);
        if (controlFunction != NULL)
            controlFunction(state);
    }

}
Ejemplo n.º 3
0
void refreshLCD(void)
{
    if (lcd.getState() != LCD_IDLE)
    {
        return;
    }

    emptyLCD();

    lcd.setCursor(0, 0);
    lcd.print(getCurrentTemperature());
    lcd.setCursor(0, 1);
    lcd.print(getCurrentDensity());
}
Ejemplo n.º 4
0
/**
 * <pre>
 * Description:
 *   Dump cell inventoy data.
 * Arguments:
 *   *tscb - Test script control block
 * </pre>
 *****************************************************************************/
Byte getEnvironmentStatus(TEST_SCRIPT_CONTROL_BLOCK *tscb)
{
  TEST_SCRIPT_ERROR_BLOCK *tseb = &tscb->testScriptErrorBlock;
  Byte rc = 0;

  ts_printf(__FILE__, __LINE__, "getEnvironmentStatus");

  rc = getCurrentTemperature(MY_CELL_NO + 1, &tscb->wCurrentTempInHundredth);
  if (rc) {
    ts_printf(__FILE__, __LINE__, "error %d", rc);
    tseb->isFatalError = 1;
  }

  rc = getCurrentVoltage(MY_CELL_NO + 1, &tscb->wCurrentV5InMilliVolts, &tscb->wCurrentV12InMilliVolts);
  if (rc) {
    ts_printf(__FILE__, __LINE__, "error %d", rc);
    tseb->isFatalError = 1;
  }

  ts_printf(__FILE__, __LINE__, "cell temp = %d, x_volt = %d, y_volt = %d", tscb->wCurrentTempInHundredth, tscb->wCurrentV5InMilliVolts, tscb->wCurrentV12InMilliVolts);

  return 0;
}
Ejemplo n.º 5
0
void printThermalZoneTemperature(const char *cmd) {
	int temperature = getCurrentTemperature(cmd);
	fprintf(CurrentClient, "%d\n", temperature);
}