芯片:stm32f10x系列
模塊:4針lcd1602模塊
程序是ok的
我(huang s y )不吝嗇分享給大家一起學習
51hei截圖_20200328121539.png (204.72 KB, 下載次數: 48)
下載附件
2020-3-28 12:19 上傳
單片機源程序如下:
- /***
- 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)
2020-3-28 14:37 上傳
點擊文件名下載附件
stm32 下載積分: 黑幣 -5
|