Exemple #1
0
void
menu_send_temp(void)
{
    int16_t result;
    uint8_t str[12];
    uint8_t * p = 0;

    /* Turn on nose LED for activity indicator */
    led_on();

    /* Get the latest temp value. */
    result = temp_get(temp_mode);

    /* Convert signed decimal number to ASCII. */
    p = signed_dectoascii(result, (str + 10));

    /* Send frame via serial port. */
    uart_serial_send_frame(SEND_TEMP, 1+strlen((char *)p), p);

#if MEASURE_ADC2
    /* Send ADC2 via serial port. */
    p = signed_dectoascii(ADC2_reading, (str + 10));
    str[9]='m';str[10]='V';str[11]=0;   //convert degrees to millivolts ;)
    uart_serial_send_frame(SEND_ADC2, 1+strlen((char *)p), p);
#endif

    led_off();
}
Exemple #2
0
/**
 *   \brief This will display the temperature in degrees F or C.
*/
void
menu_display_temp(void)
{
    int16_t result = temp_get(temp_mode);

    /* Display the temp result on the lower 4 digit display with the proper symbol. */
    if(temp_mode == TEMP_UNIT_CELCIUS){
        lcd_symbol_clr(LCD_SYMBOL_F);
        lcd_symbol_set(LCD_SYMBOL_C);
    }
    else{
        lcd_symbol_clr(LCD_SYMBOL_C);
        lcd_symbol_set(LCD_SYMBOL_F);
    }

    /* Check for the DEBUG JTAG enable bit and display a CAUTION symbol to the user. */
    /* CAUTION represents false value. */
    if(MCUCR & 0x80){
        lcd_symbol_clr(LCD_SYMBOL_ATT);
    }
    else{
        lcd_symbol_set(LCD_SYMBOL_ATT);
    }

    lcd_num_putdec(result, LCD_NUM_PADDING_SPACE);
}
Exemple #3
0
// temp_external: retrieve the external temperature of the capsule in tenths of
// degrees C
int temp_external()
{
  int t = temp_get(EXTERNAL);
  
  if ( t > -2730 ) {
    fdr_min_external( t );
  }
  
  return t;
}
Exemple #4
0
// temp_internal: retrieve the internal temperature of the capsule in tenths of
// degrees C
int temp_internal()
{
  int t = temp_get(INTERNAL);
  
  if ( t > -2730 ) {
    fdr_min_internal( t );
  }

  return t;
}
Exemple #5
0
static SCPI_parse_t SCPI_IC_meas_temp(void)
{
    uint8_t channel;
    temp_1_20_t T;

    channel = get_temp_channel();
    T = temp_get(channel);
    SCPI_print_temp_1_20(T);

    return SCPI_parse_end;
}
void sim_report_temptables(int sensor) {
  int i ;
  temp_sensor_t s, first = sensor, last = sensor+1 ;

  // sensor is a specific sensor or -1 for "all sensors"
  if (sensor == -1) {
    first = 0;
    last = NUM_TEMP_SENSORS;
  }

  sei();
  analog_init();
  printf("; Temperature sensor test %d\n", sensor);
  for (s = first; s < last; s++ ) {
    printf("; Sensor %d\n", s);
    for (i = 0 ; i < 1024 ; i++ ) {
      analog_read_value = i ;
      temp_sensor_tick() ;
      uint16_t temp = temp_get(s);
      printf("%d %.2f\n", i, ((float)temp)/4 ) ;
    }
  }
}