程序stm32F103vet6的FSMC_TFT液晶显示(ILI9325)
单片机源程序如下:
- /***************************************/
- #include "ILI9325_GUI.h"
- #include "stm32f10x.h"
- #include "ili9325.h"
- #include "usart.h"
- #include "Hanzi.h"
- #include "Touch.h"
- #include "NRF24L01.h"
- /***************************************/
- #define INING 0x00 //进车中信号
- #define IN 0x11 //进车中信号
- #define PARK3Y 0x22 //车位3有车信号
- #define PARK3N 0x33 //车位3无车信号
- #define PARK5Y 0x44 //车位5有车信号
- #define PARK5N 0x55 //车位5无车信号
- #define PARK6Y 0x66 //车位6有车信号
- #define PARK6N 0x77 //车位6无车信号
- #define OUT 0x88 //出车完毕信号
- #define OUTING 0x99 //出车完毕信号
- void Parking(u8 num,u16 color);
- int Touch_x,Touch_y;
- extern int OffsetX,OffsetY;
- u8 x[6],y[6],N = 0x22;
- u8 RxFlag = 0;
- u8 RxBuffer = 0;
- int main(void)
- {
- SystemInit();
- SysTick_Init(72);
- uart_inint(9600);
- STM3210E_LCD_Init();
- //SPI_Configration(); //触摸屏初始化
- NRF_Configration(); //无线初始化
- Init_IO();
- TX_NRF24L01();
- LCD_Clear(White);
- //Tocuh_Set();
- Drawline(0,80,240,80,Blue);
- Drawline(0,160,240,160,Blue);
- Drawline(80,0,80,160,Blue);
- Drawline(160,0,160,160,Blue);
- Parking(1,Red);
- Parking(2,Red);
- Parking(3,Green);
- Parking(4,Red);
- Parking(5,Green);
- Parking(6,Green);
- Typing(64,170,Hanzi16x16[0],7,Blue,White);
- Pantany(24,210,40,226,Green);
- Typing(45,210,Hanzi16x16[7],3,Blue,White);
- Pantany(24,230,40,246,Red);
- Typing(45,230,Hanzi16x16[10],3,Blue,White);
- Typing(96,270,Hanzi16x16[24],3,Blue,White);
- while(1)
- {
- if(1 == RxFlag)
- {
- RxFlag = 0;
- if(PARK3Y == RxBuffer) Parking(3,Green);
- if(PARK3N == RxBuffer) Parking(3,Red);
- if(PARK5Y == RxBuffer) Parking(5,Green);
- if(PARK5N == RxBuffer) Parking(5,Red);
- if(PARK6Y == RxBuffer) Parking(6,Green);
- if(PARK6N == RxBuffer) Parking(6,Red);
- if(INING == RxBuffer)
- {
- Pantany(0,250,240,320,White);
- Typing(72,270,Hanzi16x16[13],6,Blue,White);
- }
- if(OUTING == RxBuffer)
- {
- Pantany(0,250,240,320,White);
- Typing(80,270,Hanzi16x16[19],5,Blue,White);
- }
- if(OUT == RxBuffer)
- {
- Pantany(0,250,240,320,White);
- Typing(96,270,Hanzi16x16[24],3,Blue,White);
- }
- if(IN == RxBuffer)
- {
- Pantany(0,250,240,320,White);
- Typing(96,270,Hanzi16x16[24],3,Blue,White);
- }
- RxBuffer = 0;
- }
- }
- }
- void Parking(u8 num,u16 color)
- {
- switch(num)
- {
- case 1: Pantany(0,0,79,79,color);Showstring(36,36,"1",Blue,color);break; //1号车位有无空位 红色为无,绿色有。
- case 2: Pantany(81,0,159,79,color);Showstring(116,36,"2",Blue,color);break;//2
- case 3: Pantany(161,0,239,79,color);Showstring(196,36,"3",Blue,color);break;//3
- case 4: Pantany(0,81,79,159,color);Showstring(36,116,"4",Blue,color);break;//4
- case 5: Pantany(81,81,159,159,color);Showstring(116,116,"5",Blue,color);break;//5
- default: Pantany(161,81,239,159,color);Showstring(196,116,"6",Blue,color);//6
- }
- }
复制代码
所有资料51hei提供下载:
程序stm32F103vet6的FSMC_TFT液晶显示(ILI9325).rar
(319.94 KB, 下载次数: 161)
|