double Adafruit_MAX31855::readFarenheit(void) {
  float f = readCelsius();
  f *= 9.0;
  f /= 5.0;
  f += 32;
  return f;
}
Exemplo n.º 2
0
int main()
{
    double celsius;
    double fahrenheit;

    readCelsius(celsius);
    calculatefahrenheit(celsius, fahrenheit);
    displayFahrenheit(fahrenheit);

    return 0;
}
Exemplo n.º 3
0
int main ()
{
	uint8_t i;
	usart_init (BRR_VAL);
	max6675_init ();
	
	while (1)
	{
		buffer (readCelsius());
		for (i=0;i<4;++i)
		{
			transmit_byte (buff[i]);
		}
		
		_delay_ms (500);
	}
	
}
Exemplo n.º 4
0
double MAX6675::readFarenheit(void) {
  return readCelsius() * 9.0/5.0 + 32;
}
Exemplo n.º 5
0
void TIM14_IRQHandler(void)
{
	
	static uint16_t i=0,j=0,k=0,t=0;
	TIM14->SR &= ~TIM_SR_UIF;	
	++t;
	if (t>300)
	{
		current_temp = readCelsius();
		t=0;
	}
	
	if (k>500)
	{
		button_enc_flags.tim ^=1;
		if(button_enc_flags.tim)
		{
			//off indicator for blinking
			TIM17->CR1 &= ~TIM_CR1_CEN;
			GPIOA->ODR &= ~0x0F;
			k=0;
		}
		else
		{
			TIM17->CR1 |= TIM_CR1_CEN;
			k=0;
		}
			
	}
	//counter for blinking
	if (flag_seg)++k;
	else TIM17->CR1 |= TIM_CR1_CEN;

	
	//===Encoder===//
	//Short press
	if (i>25&&i<300&&GPIOA->IDR&(1 << 11))
	{
			flag1=1;
			i=0;
	}
	
	//long press
	if (i>2000&&(!(GPIOA->IDR&(1 << 11))))
	{
		flag1=2;
		i=0;
	}	
	
	//===Button===//
	//Short press
		if (i>25&&i<300&&GPIOA->IDR&(1 << 10))
	{
			flag1=3;
			j=0;
	}
	
		//long press
	if (i>2000&&(!(GPIOA->IDR&(1 << 10))))
	{
			flag1=4;
			j=0;
	}		
	
		if (!(GPIOA->IDR&(1 << 11)))++i;
		else i=0;
		

		if (!(GPIOA->IDR&(1 << 10)))++j;
		else j=0;
}
float OneWireTemperatureSensor::readCelsius() {
	return readCelsius(0);
}