toilet

LCD16X2 PASSWORD LOCK

Thảo luận trong 'Họ ARM'

Đang xem chủ đề này ( Thành viên: 0, Khách: 0)

  1. Đăng 14/12/16 #1

    Trần Tài Học sinh trung cấp

    Số bài viết: 48
    Đã được thích: 5
    Mọi người cho em hỏi về code (thuật toán) nhập ký tự vào LCD16x2 từ ma trận phím mà hiển thị liên tục các ký tự với! Em thử code rồi nhưng mãi không được!!!
    Ví dụ: bấm phím 1 thì hiện 1, bấm tiếp phím 2 thì sẽ thêm tiếp số 2 ngay sau số 1.....
    Em cám ơn rất nhiều ạ!
    #1
  2. Đăng 14/12/16 #2

    TDM1 Học sinh phổ thông

    Số bài viết: 2
    Đã được thích: 1
    bạn gửi code chưa được lên đây.
    Trần Tài thích bài này.
    #2
  3. Đăng 14/12/16 #3

    Trần Tài Học sinh trung cấp

    Số bài viết: 48
    Đã được thích: 5
    Em gửi code phần main, còn code full ở file dưới ạ!!! Em cám ơn!!!
    Mã:
    /**
      ******************************************************************************
      * Ten Tep        :            main.c
      * Tac Gia        :              Nguyen Quy Nhat
      * Cong Ty        :              MinhHaGroup
      *    Website     :              MinhHaGroup.com
      * Phien Ban    :              V1.0.0
      * Ngay          :            31-07-2012
      * Tom Tat   :       Dinh nghia ham main.                     
      *         
      *
      ******************************************************************************
      * Chu Y        :
      *                           
      ******************************************************************************
      */
    #include "main.h"
    #include "var.h"
    /*********************************EXTERN VARIABLE***********************************/
    int main(void)
    {
    /***********************************BIEN CUC BO*************************************/
    char str[20];
    uint8_t Key;
        int cursor = 192;
        int i = 0;
    /***********************************SYSTEM******************************************/
    SystemInit();
    
    /************************************NVIC*******************************************/
    //NVIC_Configuration();
                          
    /************************************GPIO*******************************************/
    GPIO_Configuration();
    
    /************************************TIMER*******************************************/
    //+++++++++++++++++++++++++++++++++++TIMER1+++++++++++++++++++++++++++++++++++++++++++
    //TIMER1_Configuration();
    
    //+++++++++++++++++++++++++++++++++++TIMER2+++++++++++++++++++++++++++++++++++++++++++
    //TIMER2_Configuration();
    
    //+++++++++++++++++++++++++++++++++++TIMER3+++++++++++++++++++++++++++++++++++++++++++
    //TIMER3_Configuration();  
    
    /************************************DMA********************************************/
    //+++++++++++++++++++++++++++++++++++DMA1+++++++++++++++++++++++++++++++++++++++++++
    //DMA1_Configuration();
    
    //+++++++++++++++++++++++++++++++++++DMA2+++++++++++++++++++++++++++++++++++++++++++
    //DMA1_Configuration();
    
    /************************************ADC********************************************/
    //++++++++++++++++++++++++++++++++++ADC1+++++++++++++++++++++++++++++++++++++++++++
    //ADC1_Configuration();
    
    //+++++++++++++++++++++++++++++++++ADC2+++++++++++++++++++++++++++++++++++++++++++
    //ADC2_Configuration();  
    
    //+++++++++++++++++++++++++++++++++ADC3++++++++++++++++++++++++++++++++++++++++++
    //ADC3_Configuration();
    
    /************************************USART********************************************/
    //+++++++++++++++++++++++++++++++++USART1++++++++++++++++++++++++++++++++++++++++++
    // USART1_Configuration();
      
    //+++++++++++++++++++++++++++++++++USART2++++++++++++++++++++++++++++++++++++++++++
    //+++++++++++++++++++++++++++++++++USART3++++++++++++++++++++++++++++++++++++++++++
    //+++++++++++++++++++++++++++++++++USART4++++++++++++++++++++++++++++++++++++++++++
    /****************************** USER FUNCITION *************************************/  
      delay_init(72);
        LCD_Init();
    /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                     EXCUTION
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    
    /****************************************************************************
    ****************************************************************************/
    LCD_Puts("MinhHaGroup");
    LCD_Gotoxy(0,1);
    //LCD_Puts("BanLinhKien.Vn");
    while(1)
    {
         Key = KEY4X4_GetKey();
         //LCD_Gotoxy(0,1);
         for(i = 0; i < 3; i++)
            {
         if(Key)
         {
                sprintf(str,"%c",Key);
             //LCD_PutChar(Key);
                LCD_Gotoxy(0,1);
             LCD_SendCommand(cursor);
             cursor++;
           
                //LCD_Puts((uint8_t *)str);
                //while(Key)Key = KEY4X4_GetKey();
         }
          } 
    }
    }
    /******************* (C) COPYRIGHT 2012 Nguyen Quy Nhat *****END OF FILE****/
    
    

    Các file đính kèm:

    #3

Chia sẻ trang này