芯片:stm32f10x系列
模块:4针lcd1602模块
程序是ok的
我(huang s y )不吝啬分享给大家一起学习
单片机源程序如下:
- /***
- Copyright (c) 2016
- All rights reserved.
-
- 文件名称:main.c
- 文件标识:HMI
- 摘 要:基于HMI显示的测试工程
-
-
- 当前版本:
- 作 者:Hacker
- 完成日期:2016-1-23 17:29:14
-
- 取代版本:
- 原作者 :
- 完成日期:
-
- Copyright (c) 2016
- All rights reserved.
-
- File name :main.c
- file identification :
- Subject :A matrix led project based on MAX7219
- @example Matrix_printf("string");
- Hello World character will be shown on matrix led
-
- Current Version :
- Author :Hacker
- Date :2016-1-23 17:29:14
-
- Instead Version :
- Date :
- ***/
- #include "stm32f10x.h"
- #include "binary.h"
- #include "delay.h"
- #include "usart1.h"
- #include "1602_iic_sw.h"
- extern u8 buffer[10];
- /*
- * 函数名:main
- * 描述 : 主函数
- * 输入 :无
- * 输出 : 无
- */
- int main(void)
- {
- int i = 0x21;
- int j = 0;
-
- DelayInit(72);
- USART1_Config();
- init_1602();
-
- printf("\r\n开始调试r\n");
- setCursor(3, 0);
-
- // printf("debug:1\r\n");
- // lcdPrint("hello");
- // Delay1ms(2000);
- // printf("debug:2\r\n");
- // setCursor(0, 1);
- // printf("debug:3\r\n");
- // lcdPrint("12345067");
- // setCursor(0,0);
- //
-
- while(1)
- {
- writeOneChar(DATA, i);
- Delay1ms(500);
- i++;j++;
- if(j == 16)
- {
- setCursor(0, 1);
- j = 0;
- }
- if(i == 255)
- {
- setCursor(0, 1);
- i = 0x21;
- }
- }
- // add your code here ^_^。
- }
- /******************* (C) COPYRIGHT 2016 Hacker *****END OF FILE************/
复制代码
所有资料51hei提供下载:
STM32+4针LCD1602程序.7z
(190.06 KB, 下载次数: 29)
|