60 lines
870 B
C
60 lines
870 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"
|
|
|
|
|
|
unsigned long tempA;
|
|
float vol;
|
|
void app_act (void)
|
|
{
|
|
//1按键操作
|
|
Key_Scan();//按键扫描
|
|
key_act(); //按键执行功能
|
|
|
|
//2定时器
|
|
//if(it_1000ms_flag == 1)
|
|
//{
|
|
// it_1000ms_flag = 0;
|
|
//HAL_GPIO_TogglePin(LED_NOR_GPIO_Port,LED_NOR_Pin);
|
|
|
|
//M1820_Act();
|
|
|
|
//}
|
|
|
|
//3 串口通信
|
|
//Tx_RX_UART1();
|
|
//uart_test();
|
|
|
|
//4 OLED
|
|
// if(it_100ms_flag)
|
|
// {
|
|
// it_100ms_flag = 0;
|
|
// OLED_Act();
|
|
// }
|
|
|
|
//5 电阻尺 位移传感器
|
|
// tempA = GetAD(4);
|
|
// tempA = (float)tempA*1000*2.499/(1048575) + 150;//20位精度
|
|
|
|
//6 电机
|
|
if(it_1000ms_flag)
|
|
{
|
|
it_1000ms_flag = 0;
|
|
tmc5160_act();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|