This repository has been archived on 2024-12-31. You can view files and clone it, but cannot push or open issues or pull requests.
mfps/App/Src/app.c

60 lines
854 B
C

#include "main.h"
#include "i2c.h"
#include "spi.h"
#include "tim.h"
#include "usart.h"
#include "gpio.h"
#include "key.h"
#include "app.h"
#include "serial_port.h"
#include "m1820.h"
#include "oled.h"
#include "ads1220.h"
#include "tmc5160.h"
float X_ads1220;
float vol;
void app_act (void)
{
//1按键操作
Key_Scan();//按键扫描
key_act(); //按键执行功能
//2定时器
if(it_1000ms_flag == 1)
{
it_1000ms_flag = 0;
M1820_Act(); //温度采集
X_ads1220 = GetAD(4); //电阻尺采集
tmc5160_act(); //电机执行功能
}
//3 串口通信
//Tx_RX_UART1();
//uart_test();
//4 OLED
if(it_100ms_flag)
{
it_100ms_flag = 0;
OLED_Act();
}
//5 电阻尺 位移传感器
// X_ads1220 = GetAD(4);
//6 电机
// if(it_1000ms_flag)
// {
// it_1000ms_flag = 0;
// tmc5160_act();
// }
}