欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: 基于STM32和lcd1602例程 [打印本頁(yè)]

作者: 踏步如云    時(shí)間: 2019-3-20 17:09
標(biāo)題: 基于STM32和lcd1602例程
#include "lcd1602.h"
#include "delay.h"
#include "stdio.h"
void GPIO_Configuration(void)
{
        GPIO_InitTypeDef        GPIO_InitStructure;
        
        RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA | RCC_AHB1Periph_GPIOD,ENABLB);

        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
        GPIO_Init(GPIOB, &GPIO_InitStructure);                        

        GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2;
        GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT
    GPIO_InitStructure.GPIO_OType = GPIO_OType_PP
        GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
        GPIO_Init(GPIOA, &GPIO_InitStructure);                        
}
void LCD1602_Wait_Ready(void)
{
        u8 sta;
        
        DATAOUT(0xff);
        LCD_RS_Clr();
        LCD_RW_Set();
        do
        {
                LCD_EN_Set();
                delay_ms(5);
                 sta = GPIO_ReadInputDataBit(GPIOD, GPIO_Pin_7);
                LCD_EN_Clr();
        }while(sta & 0x80)
}
void LCD1602_Write_Cmd(u8 cmd)
{
        LCD1602_Wait_Ready();
        LCD_RS_Clr();
        LCD_RW_Clr();
        DATAOUT(cmd);
        LCD_EN_Set();
        LCD_EN_Clr();
    //printf("%d",cmd);
}

lcd1602顯示.7z

293.2 KB, 下載次數(shù): 73, 下載積分: 黑幣 -5


作者: 醉里挑燈看雪    時(shí)間: 2019-4-28 10:36
你好,可以加一下qq嗎,我這個(gè)現(xiàn)在還是只能點(diǎn)亮,但是不顯示東西,很苦惱
作者: 踏步如云    時(shí)間: 2019-11-29 13:59
醉里挑燈看雪 發(fā)表于 2019-4-28 10:36
你好,可以加一下qq嗎,我這個(gè)現(xiàn)在還是只能點(diǎn)亮,但是不顯示東西,很苦惱

確認(rèn)一下引腳和電位器
作者: yanghon214    時(shí)間: 2019-11-29 14:28
謝謝共享謝謝共享




歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1