コード例 #1
0
void cthd_topology::temp_function()
{
	int i;

	// core temp sensor index starts at 2
	for(i = 2; i < no_sensors; ++i)
	{
		check_temperature(i);
	}
}
コード例 #2
0
main()
{ 
ds1307_init(); 

// Set date for -> 15 June 2005 Tuesday 
// Set time for -> 15:20:55 
//ds1307_set_date_time(18,11,12,2,22,05,55); 


  setup_adc(ADC_CLOCK_INTERNAL);
//enables the a/d module 
  set_adc_channel(0);
//the next read_adc call will read channel 0
  delay_us(10);
//a small delay is required after setting the channel

//aguarda 100ms
  delay_ms(100);

//inicializa o display LCD
  inic_display();

  while (true)
  {

    switch(tela){
      case 0:
        display(0,0x01);
        update_clock();
        read_temperature();
        check_temperature();
        show_temperature();
        show_clock();

        if(tecla_set_status && !tecla_menos_status && tecla_mais_status)
          tela = 2;

        if(tecla_set_status && tecla_menos_status && !tecla_mais_status)
          tela = 1;
        

        break;
      case 1:
        read_temperature();
        configure_temperature();
        break;
      case 2:
        //update_clock();
        configure_time();
        break;
    }

//alterna o estado do pino D4
    //output_toggle(PIN_D1);

    verifica_teclas();

//aguarda 500ms
    delay_ms (100);
  }
}