к1986ве92fi подключение датчика MAX6675_часть3
к1986ве92fi подключение датчика MAX6675_часть3
#include "CPU_CLK.h" #include "Timer_init.h" #include "SPI_Init.h" #include "Port_init.h" #include "Barometer.h" #include "Uart_init.h" //#include "hdc1080.h" #include "sensors.h" #include "SPI_Prog.h" // Глобальные переменные для данных float temperature = 0; float pressure = 0; int main(void) { float temp; char buf[32]; RST_CLK_PCLKcmd(RST_CLK_PCLK_RST_CLK, ENABLE); CPU_CLK_80MHz_Config(); STick_Init(); PORT_AllInit(); PWM_Init(); UART1_Init(); //SPI1_Init(); I2C1_Init(); // PressInit(); // ADC1_InitPeriph(); // DMA1_Init(); // TIMER2_Init(); //Sensors_Init(); MAX6675_Init(); while (1) { { temp = MAX6675_ReadTemperature(); if (temp ﹤ -900) { UART1_SendString("ERROR: Thermocouple open!\r\n"); } else { sprintf(buf, "Temp: %.2f C\r\n", temp); UART1_SendString(buf); } } Delay(500); LED_On(); Delay(100); LED_Off(); Delay(1000); } }