[其他ST产品] newlab平台stm32总结

[复制链接]
1995|59
 楼主| 纠结的那些年 发表于 2023-8-26 17:57 | 显示全部楼层 |阅读模式
一、GPIO的输出
1.时钟设置
2.调用初始化函数
3.输出函数
(1)GPIO_WriteBit(端口,引脚,(BitAction)(0));//低
GPIO_WriteBit(端口,引脚,(BitAction)(1));//高
(2)GPIO_SetBits(端口,引脚); //低
GPIO_ResetBits端口,引脚); //高
(3)PAout(n) = 1:PAn;//输出高
PAout(n) = 0;//输出低
P端口out(引脚) = 0|1
(4)PAin(n) = 1;//输入高
PAin(n) = 0;//输入低
P端口in(引脚) = 0|1

评论

———————————————— 版权声明:本文为CSDN博主「Baal Austin」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/weixin_44529350/article/details/109163581  发表于 2023-8-26 17:57
 楼主| 纠结的那些年 发表于 2023-8-26 17:57 | 显示全部楼层
  1. void Init(void){ //初始化
  2.         GPIO_InitTypeDef  GPIO_InitStructure;        
  3.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);//参数一:GPIOB口输出,参数二:使能      
  4.     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1;//B0和B1                        
  5.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP; //推挽输出
  6.     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //输出频率
  7.         GPIO_Init(LEDPORT, &GPIO_InitStructure);//初始化                       
  8. }
 楼主| 纠结的那些年 发表于 2023-8-26 17:57 | 显示全部楼层
用途
例一:
点亮led
步骤:
1.初始化时钟
2.初始化PB0,1
3.调用GPIO输出函数
连接方式:
位数码管连接3.3v
段数码管连接PB0
 楼主| 纠结的那些年 发表于 2023-8-26 17:57 | 显示全部楼层


  1. #define LEDPORT        GPIOB       
  2. #define LED1        GPIO_Pin_0       
  3. #define LED2        GPIO_Pin_1       
  4. void LED_Init(void){
  5.         GPIO_InitTypeDef  GPIO_InitStructure;        
  6.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);      
  7.     GPIO_InitStructure.GPIO_Pin = LED1 | LED2;                       
  8.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;     
  9.     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;     
  10.         GPIO_Init(LEDPORT, &GPIO_InitStructure);                       
  11. }

  12. int Led1(){
  13.         RCC_Configuration();
  14.         LED_Init();
  15.         while(1){
  16.                 GPIO_WriteBit(LEDPORT,LED1,(BitAction)(0));//低电平亮,高电平灭
  17.                 delay_ms(100);
  18.                 GPIO_WriteBit(LEDPORT,LED1,(BitAction)(1));
  19.                 delay_ms(100);
  20.         }
  21. }
 楼主| 纠结的那些年 发表于 2023-8-26 17:58 | 显示全部楼层
按键控制Led
步骤:
1.初始化按键
2.获取按键电平
GPIO_ReadInputDataBit(KEYPORT1,KEY1)
按下返回低电平0,松开返回高电平1
 楼主| 纠结的那些年 发表于 2023-8-26 17:58 | 显示全部楼层
连接方式:
  1. //按键1 C13
  2. #define KEYPORT1        GPIOC       
  3. #define KEY1        GPIO_Pin_13       

  4. //按键2 D13
  5. #define KEYPORT2 GPIOD
  6. #define KEY2        GPIO_Pin_13
  7. void KEY1_Init(void){
  8.         GPIO_InitTypeDef  GPIO_InitStructure;
  9.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);      
  10.     GPIO_InitStructure.GPIO_Pin = KEY1;      
  11.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;      
  12. //    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;   
  13.         GPIO_Init(KEYPORT1,&GPIO_InitStructure);                       
  14. }

  15. void KEY2_Init(void){
  16.         GPIO_InitTypeDef  GPIO_InitStructure;
  17.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD,ENABLE);      
  18.     GPIO_InitStructure.GPIO_Pin = KEY2;               
  19.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;  
  20. //    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  21.         GPIO_Init(KEYPORT2,&GPIO_InitStructure);                       
  22. }
 楼主| 纠结的那些年 发表于 2023-8-26 17:58 | 显示全部楼层
例二:蜂鸣器
步骤:
1.初始化时钟
2.初始化PB5
3.调用GPIO输出函数
连接方式:
 楼主| 纠结的那些年 发表于 2023-8-26 17:58 | 显示全部楼层
  1. #define BUZZERPORT        GPIOB
  2. #define BUZZER        GPIO_Pin_5
  3. void BUZZER_Init(void){
  4.         GPIO_InitTypeDef  GPIO_InitStructure;        
  5.     GPIO_InitStructure.GPIO_Pin = BUZZER;                     
  6.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;      
  7.     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  8.         GPIO_Init(BUZZERPORT, &GPIO_InitStructure);       
  9.         GPIO_WriteBit(BUZZERPORT,BUZZER,(BitAction)(1));               
  10. }
  11. void BUZZER_BEEP1(void){
  12.         u16 i;
  13.         for(i=0;i<200;i++){
  14.                 GPIO_WriteBit(BUZZERPORT,BUZZER,(BitAction)(0));
  15.                 delay_us(500);
  16.                 GPIO_WriteBit(BUZZERPORT,BUZZER,(BitAction)(1));
  17.                 delay_us(500);               
  18.         }
  19. }
 楼主| 纠结的那些年 发表于 2023-8-26 17:59 | 显示全部楼层
例三:点亮动态数码管
步骤:
1.初始化时钟
2.初始化PB0,1,2,3,4,5,6,7
3.调用GPIO输出函数
连接方式:
数码管段选输出口为PA0-7,位选输出口为PB10-13 PC6-9
 楼主| 纠结的那些年 发表于 2023-8-26 17:59 | 显示全部楼层
  1. void GPIO_Configuration(void)//时钟配置子程序
  2. {
  3.         GPIO_InitTypeDef GPIO_InitStructure;//声明GPIO初始化结构变量
  4.        
  5.         GPIO_InitStructure.GPIO_Mode=GPIO_Mode_Out_PP;
  6.         GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  7.         GPIO_InitStructure.GPIO_Pin=GPIO_Pin_7|GPIO_Pin_6|GPIO_Pin_5|GPIO_Pin_4|GPIO_Pin_3|GPIO_Pin_2|GPIO_Pin_1|GPIO_Pin_0;
  8.         GPIO_Init(GPIOA,&GPIO_InitStructure);
  9.        
  10.         GPIO_SetBits(GPIOA,GPIO_InitStructure.GPIO_Pin);
  11.        
  12.         GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10|GPIO_Pin_11|GPIO_Pin_12|GPIO_Pin_13;
  13.         GPIO_Init(GPIOB,&GPIO_InitStructure);
  14.         GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9|GPIO_Pin_8|GPIO_Pin_7|GPIO_Pin_6;
  15.         GPIO_Init(GPIOC,&GPIO_InitStructure);
  16.        
  17.         GPIO_SetBits(GPIOB,GPIO_InitStructure.GPIO_Pin);

  18. }

  19. void Show_Num(double num){
  20.        
  21.                 double num1 = num;
  22.                 unsigned char index = 0;
  23.                 unsigned int n = 1;
  24.                 unsigned int num2;
  25.                 unsigned char i;
  26.                 while((unsigned int)num1 != num1&&index < 4){
  27.                         index++;
  28.                         num1 = num1*10;
  29.                         n = n*10;
  30.                 }
  31.                 num2 = num1;
  32.                 LedOut[0]=Disp_Tab[num2/10000000%10];
  33.                 LedOut[1]=Disp_Tab[num2/1000000%10];   
  34.                 LedOut[2]=Disp_Tab[num2/100000%10];       
  35.                 LedOut[3]=Disp_Tab[num2/10000%10];         
  36.        
  37.                 LedOut[4]=Disp_Tab[num2/1000%10];
  38.                 LedOut[5]=Disp_Tab[num2/100%10];
  39.                 LedOut[6]=Disp_Tab[num2/10%10];
  40.                 LedOut[7]=Disp_Tab[num2%10];     
  41.                 LedOut[7-index]=Disp_Tab1[num2/n%10];
  42.                
  43.                
  44.                
  45.                 for(i=0; i<8; i++)
  46.                 {               
  47.                         GPIO_Write(GPIOA , LedOut[i])        ;       
  48.                         LED1(0);LED2(0);LED3(0);LED4(0);LED5(0);LED6(0);LED7(0);LED8(0);
  49.                         switch(i)                                          
  50.                         {
  51.                                 case 0:       
  52.                                         LED1(1);LED2(0);LED3(0);LED4(0);LED5(0);LED6(0);LED7(0);LED8(0);
  53.                                         break;         
  54.                                 case 1:
  55.                                         LED1(0);LED2(1);LED3(0);LED4(0);LED5(0);LED6(0);LED7(0);LED8(0);
  56.                                         break;                    
  57.                                 case 2:
  58.                                         LED1(0);LED2(0);LED3(1);LED4(0);LED5(0);LED6(0);LED7(0);LED8(0);
  59.                                         break;
  60.                                 case 3:
  61.                                         LED1(0);LED2(0);LED3(0);LED4(1);LED5(0);LED6(0);LED7(0);LED8(0);
  62.                                         break;
  63.                                 case 4:       
  64.                                         LED1(0);LED2(0);LED3(0);LED4(0);LED5(1);LED6(0);LED7(0);LED8(0);
  65.                                         break;
  66.                                 case 5:       
  67.                                         LED1(0);LED2(0);LED3(0);LED4(0);LED5(0);LED6(1);LED7(0);LED8(0);
  68.                                         break;
  69.                                 case 6:
  70.                                         LED1(0);LED2(0);LED3(0);LED4(0);LED5(0);LED6(0);LED7(1);LED8(0);
  71.                                         break;
  72.                                 case 7:       
  73.                                         LED1(0);LED2(0);LED3(0);LED4(0);LED5(0);LED6(0);LED7(0);LED8(1);
  74.                                         break;
  75.                          }
  76.                         delay_nms(1);
  77.                 }
  78.        
  79. }

 楼主| 纠结的那些年 发表于 2023-8-26 17:59 | 显示全部楼层
#include "stm32f10x.h"                  // Device header
#include "dynamic_seg_led.h"
int main(void)
{
        RCC_Configuration1();//配置时钟
        GPIO_Configuration();//配置GPIO口
        LED1(0);LED2(0);LED3(0);LED4(0);LED5(0);LED6(0);LED7(0);LED8(0);//熄灭所有数码管
        while(1){
          Show_Num(1234.5678);//显示想显示的数
        }
}

 楼主| 纠结的那些年 发表于 2023-8-26 17:59 | 显示全部楼层
例四: 驱动灯泡,风扇,门锁
步骤:
与例一相同
线路连接:
GPIO输出口连接继电器J2(J5),J9(J12)连接设备正极,J8(J11)连接电源正极12V,设备负极连接电源负极
 楼主| 纠结的那些年 发表于 2023-8-26 18:00 | 显示全部楼层
例五: 键盘模块
步骤:
1.时钟设置
2.44或55键盘初始化
3.获取按键信息,如将获取的信息显示在数码管上
连线:
4*4键盘
COL0-COL3 PB10-PB13
ROW0-ROW3 PC6-PC9
 楼主| 纠结的那些年 发表于 2023-8-26 18:00 | 显示全部楼层
 楼主| 纠结的那些年 发表于 2023-8-26 18:00 | 显示全部楼层
5*5键盘
ROW0-ROW4 PA0-PA4
COL4-COL0 PB14-PB10
 楼主| 纠结的那些年 发表于 2023-8-26 18:00 | 显示全部楼层
 楼主| 纠结的那些年 发表于 2023-8-26 18:00 | 显示全部楼层
  1. //键盘初始化
  2. void GPIO_Configuration55(void)
  3. {

  4.        
  5.                 GPIO_InitTypeDef GPIO_InitStructure;//声明GPIO初始化结构变量
  6.                 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); //开启PA时钟
  7.     RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE); //开启PB时钟
  8.                 RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE); //开启PC时钟
  9.                
  10.                 GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4|GPIO_Pin_3|GPIO_Pin_2|GPIO_Pin_1|GPIO_Pin_0;
  11.                 GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;  //配置成推挽输出
  12.                 GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //输出速度 50M HZ
  13.                 GPIO_Init(GPIOA, &GPIO_InitStructure);  //初始化PA口

  14.           GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10 |  GPIO_Pin_11 |  GPIO_Pin_12 |  GPIO_Pin_13 |  GPIO_Pin_14;  
  15.     GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;  //上拉输入
  16.     GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; //
  17.     GPIO_Init(GPIOB, &GPIO_InitStructure);  //初始化PB口
  18.                 GPIO_Write(GPIOB, 0x7C00); //上拉输入需要把对应的ODR置1

  19. }

  20. /*
  21. 5*5矩阵按键设置
  22. */
  23. int  keyscan55(void)
  24. {        
  25.          ROW14(0);ROW13(0);ROW12(0);ROW11(0);ROW10(0);//ÐÐÏßÀ­µÍ
  26. //                      |                        |                        |                        |     |
  27. // 0 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  28. //                      |                        |                        |                        |     |   --------
  29. // 0 PA1 ---5-----6-----7-----8-----9--
  30. //                      |                        |                        |                        |     |
  31. // 0 PA2 ---A-----B-----C-----D-----E--
  32. //                      |                        |                        |                        |     |
  33. // 0 PA3 ---F-----H-----I-----J-----K--
  34. //                      |                        |                        |                        |     |
  35. // 0 PA4 ---L-----M-----N-----O-----P--
  36. //          |     |     |     |     |
  37. //                           PB14 PB13  PB12   PB11  PB10
  38. //   
  39.                 if(COL14&&COL13&&COL12&&COL11&&COL10){
  40.                         return -1;
  41.                 }
  42.                 else
  43.                 {
  44.                         delay_nms(5);
  45.                         if(COL14&&COL13&&COL12&&COL11&&COL10)
  46.                                 return -1;
  47.                 }
  48.                
  49. //                      |                        |                        |                        |     |
  50. // 0 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  51. //                      |                        |                        |                        |     |   --------
  52. // 1 PA1 ---5-----6-----7-----8-----9--
  53. //                      |                        |                        |                        |     |
  54. // 1 PA2 ---A-----B-----C-----D-----E--
  55. //                      |                        |                        |                        |     |
  56. // 1 PA3 ---F-----H-----I-----J-----K--
  57. //                      |                        |                        |                        |     |
  58. // 1 PA4 ---L-----M-----N-----O-----P--
  59. //          |     |     |     |     |
  60. //                           PB14 PB13  PB12   PB11  PB10
  61. //   
  62.                 ROW14(1);ROW13(1);ROW12(1);ROW11(1);ROW10(0);
  63.                 if(!COL14){
  64.                         return 0;
  65.                 }
  66.                 if(!COL13){
  67.                         return 1;
  68.                 }
  69.                 if(!COL12){
  70.                         return 2;
  71.                 }
  72.                 if(!COL11){
  73.                         return 3;
  74.                 }
  75.                 if(!COL10){
  76.                         return 4;
  77.                 }
  78. //                      |                        |                        |                        |     |
  79. // 1 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  80. //                      |                        |                        |                        |     |   --------
  81. // 0 PA1 ---5-----6-----7-----8-----9--
  82. //                      |                        |                        |                        |     |
  83. // 1 PA2 ---A-----B-----C-----D-----E--
  84. //                      |                        |                        |                        |     |
  85. // 1 PA3 ---F-----H-----I-----J-----K--
  86. //                      |                        |                        |                        |     |
  87. // 1 PA4 ---L-----M-----N-----O-----P--
  88. //          |     |     |     |     |
  89. //                           PB14 PB13  PB12   PB11  PB10
  90. //   
  91.                 ROW14(1);ROW13(1);ROW12(1);ROW11(0);ROW10(1);
  92.                 if(!COL14){
  93.                         return 5;
  94.                 }
  95.                 if(!COL13){
  96.                         return 6;
  97.                 }
  98.                 if(!COL12){
  99.                         return 7;
  100.                 }
  101.                 if(!COL11){
  102.                         return 8;
  103.                 }
  104.                 if(!COL10){
  105.                         return 9;
  106.                 }
  107.                
  108. //                      |                        |                        |                        |     |
  109. // 1 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  110. //                      |                        |                        |                        |     |   --------
  111. // 1 PA1 ---5-----6-----7-----8-----9--
  112. //                      |                        |                        |                        |     |
  113. // 0 PA2 ---A-----B-----C-----D-----E--
  114. //                      |                        |                        |                        |     |
  115. // 1 PA3 ---F-----H-----I-----J-----K--
  116. //                      |                        |                        |                        |     |
  117. // 1 PA4 ---L-----M-----N-----O-----P--
  118. //          |     |     |     |     |
  119. //                           PB14 PB13  PB12   PB11  PB10
  120. //   

  121.                 ROW14(1);ROW13(1);ROW12(0);ROW11(1);ROW10(1);
  122.                 if(!COL14){
  123.                         return 10;
  124.                 }
  125.                 if(!COL13){
  126.                         return 11;
  127.                 }
  128.                 if(!COL12){
  129.                         return 12;
  130.                 }
  131.                 if(!COL11){
  132.                         return 13;
  133.                 }
  134.                 if(!COL10){
  135.                         return 14;
  136.                 }
  137. //                      |                        |                        |                        |     |
  138. // 1 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  139. //                      |                        |                        |                        |     |   --------
  140. // 1 PA1 ---5-----6-----7-----8-----9--
  141. //                      |                        |                        |                        |     |
  142. // 1 PA2 ---A-----B-----C-----D-----E--
  143. //                      |                        |                        |                        |     |
  144. // 0 PA3 ---F-----H-----I-----J-----K--
  145. //                      |                        |                        |                        |     |
  146. // 1 PA4 ---L-----M-----N-----O-----P--
  147. //          |     |     |     |     |
  148. //                           PB14 PB13  PB12   PB11  PB10
  149. //   

  150.                 ROW14(1);ROW13(0);ROW12(1);ROW11(1);ROW10(1);
  151.                 if(!COL14){
  152.                         return 15;
  153.                 }
  154.                 if(!COL13){
  155.                         return 16;
  156.                 }
  157.                 if(!COL12){
  158.                         return 17;
  159.                 }
  160.                 if(!COL11){
  161.                         return 18;
  162.                 }
  163.                 if(!COL10){
  164.                         return 19;
  165.                 }
  166. //                      |                        |                        |                        |     |
  167. // 1 PA0 ---0-----1-----2-----3-----4-- |                  |--------|
  168. //                      |                        |                        |                        |     |   --------
  169. // 1 PA1 ---5-----6-----7-----8-----9--
  170. //                      |                        |                        |                        |     |
  171. // 1 PA2 ---A-----B-----C-----D-----E--
  172. //                      |                        |                        |                        |     |
  173. // 1 PA3 ---F-----H-----I-----J-----K--
  174. //                      |                        |                        |                        |     |
  175. // 0 PA4 ---L-----M-----N-----O-----P--
  176. //          |     |     |     |     |
  177. //                           PB14 PB13  PB12   PB11  PB10
  178. //   

  179.                 ROW14(0);ROW13(1);ROW12(1);ROW11(1);ROW10(1);
  180.                 if(!COL14){
  181.                         return 20;
  182.                 }
  183.                 if(!COL13){
  184.                         return 21;
  185.                 }
  186.                 if(!COL12){
  187.                         return 22;
  188.                 }
  189.                 if(!COL11){
  190.                         return 23;
  191.                 }
  192.                 if(!COL10){
  193.                         return 24;
  194.                 }
  195.                 return -1;
  196. }
  197. void delay_nms(u16 time)//ÑÓʱ×Ó³ÌÐò
  198. {  u16 i=0;  
  199.    while(time--)
  200.    {  i=12000;  //×Ô¼º¶¨Òå
  201.       while(i--) ;
  202.    }
  203. }
 楼主| 纠结的那些年 发表于 2023-8-26 18:01 | 显示全部楼层

  1. #include "stm32f10x.h" //STM32
  2. #include "matrix_key.h"
  3. #include "usart.h"
  4. // 此表为LED的字模                    0          1        2    3           4         5        6    7           8         9     a     b           c         d     e     f
  5. unsigned char  LED7Code[] = {~0x3F,~0x06,~0x5B,~0x4F,~0x66,~0x6D,~0x7D,~0x07,~0x7F,~0x6F,~0x77,~0x7C,~0x39,~0x5E,~0x79,~0x71};
  6. int x;
  7. int main(void){
  8.         RCC_Configuration(); //时钟设置
  9.         USART1_Init(115200); //串口初始化波特率
  10.         GPIO_Configuration55();//GPIO_Configuration44();
  11.         GPIO_Write(GPIOA, LED7Code[8]);//数码管全亮
  12.   while(1)
  13.   {
  14.                 x=keyscan55();//扫描按键,返回按键值
  15.           //x=keyscan44();)
  16.                 printf("%d ",x);//串口输出
  17.                 if (x>=0)
  18.                 {
  19.                         GPIO_Write(GPIOA, LED7Code[x]);        //显示按键值;                               
  20.                 }
  21.   }
  22. }

 楼主| 纠结的那些年 发表于 2023-8-26 18:01 | 显示全部楼层
二、LCD输出
步骤:
1.初始化LCD显示屏
2.清屏
3.写数据

LCD点阵大小 12864 即8行16列
每一个英文字符占816个字节,即2行1列,两行可以显示16个英文字符
每一个中文字符占16*16个字节,即2行2列,两行可以显示8个中文字符
如果超出不显示,以上为默认情况,其他函数详见LCD12864.c文档
可使用PCTOLCD生成需要的点阵
 楼主| 纠结的那些年 发表于 2023-8-26 18:01 | 显示全部楼层
//LCD主函数
#include "stm32f10x.h"                  // Device header
#include "stm32f103_config.h"
#include "lcd12864.h"
#include "Font.h"
#include "Image.h"
int main(void)
{
        delay_ms(100);//延时100毫秒
        LCD_Init();/初始化显示屏
        LCD_Clr(); //清屏
        LCD_WriteEnglish(2,0,1+'0');
        LCD_WriteEnglish(2,8,2+'0');
        LCD_WriteEnglish(2,2*8,3+'0');
        LCD_WriteEnglish(2,3*8,4+'0');
        LCD_WriteEnglish(2,4*8,5+'0');
        LCD_WriteEnglishString(2,5*8,(unsigned char *)" end");
        LCD_WriteEnglishString(4,0,(unsigned char *)"0123456789ABCDEF");*/
        LCD_WriteEnglishString(0,0,(unsigned char *)" HUNAN CITY");
        LCD_WriteEnglishString(2,0,(unsigned char *)"  University");
        LCD_WriteChineseString(4,0,(unsigned char *)hanzi,6);
  //LCD_DispImg(2,48,60,60,(unsigned char *)Fig0);       
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

56

主题

751

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部