1、2.1. 方案设计使用Keil uvision4 软件对STM32 OPEN407Z-C测试版编程。3. 设计3.1. 硬件设计 3.1.1 原理图 3.1.2 LCD液晶屏端口3.1.3 用户按键 3.1.4 摇杆键3.2. 软件设计3.2.1. 主要函数说明(1) 函数1A. 函数原型int main(void) GPIO_Configuration(); LCD_Initializtion(); LCD_Clear(Blue); GUI_Chinese(80,40,苏州大学应用技术学院,White,Blue); GUI_Text(100,60,10 GUI_Chinese(120,60,
2、信息 GUI_Chinese(160,60,第一组 GUI_Chinese(100,80,朱勇 GUI_Chinese(160,80,杨志明 GUI_Chinese(100,100,许多 GUI_Chinese(160,100,苏仁阳 GUI_Chinese(80,160,请选择输入位数 sprintf(s1,%d,n); GUI_Text(240,160,(uint8_t*)s1,White,Blue);B. 函数实现实现欢迎界面的显示,结构体的初始化。(2) 函数2#include stm32f10x.hLCD/LCD.h#include #ifdef _GNUC_ /* With GCC
3、/RAISONANCE, small printf (option LD Linker-Libraries-Small printf set to Yes) calls _io_putchar() */ #define PUTCHAR_PROTOTYPE int _io_putchar(int ch)#else #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)#endif /* _GNUC_ */int n=1;int a;int b;int c;int d;int e;int sum;int flag=1;char s130;char
4、s230;/* Private function prototypes -*/void GPIO_Configuration(void);void USART_Configuration(void);void tran(void);void sums(void);void ap(void);void bp(void);void cp(void);void dp(void);void ep(void);void ah(void);void bh(void);void ch(void);void dh(void);void eh(void);/* Function Name : Delay* De
5、scription : Delay Time* Input : - nCount:* Output : None* Return :* Attention :*/void Delay (uint32_t nCount) for(; nCount != 0; nCount-);void FLAG() if(!(GPIOC-IDR & 0x0004) flag=flag-1; if(flag 0x0001) flag=flag+1; if(flagn) flag=n; sprintf(s2,flag); GUI_Text(100,60,(uint8_t*)s2,White,Blue);void a
6、p() if(!IDR&0X0002)&(flag=1) a=a+1; if(a9) a=9; Delay(0xfffff); 0X0008)& a=a-1; if(a b=9; b=b-1; if(b c=9; c=c-1; if(c d=9; d=d-1; if(d e=9; e=e-1; if(e e=0;void ah() sprintf(s1,a); switch (a) case 1: GUI_Chinese(60,120,一break; case 2:二 case 3:三 case 4:四 case 5:五 case 6:六 case 7:七 case 8:八 case 9:九 case 0:零 void bh(),b); switch (b) GUI_Chinese(100,120,Whi
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1