+ Post New Thread
Results 1 to 4 of 4
  1. #1
    Advanced Member level 2
    Points: 3,524, Level: 13
    imranahmed's Avatar
    Join Date
    Dec 2011
    Location
    Karachi,Pakistan
    Posts
    595
    Helped
    2 / 2
    Points
    3,524
    Level
    13

    Programming for Display Board using Arduino+keypad+Max7221+LCD

    Please let me know that I am using Arduino Mega2560 with keypad + MAX7221 + LCD

    And I want to cascade MAX7221 ICs so my question is that would I write these functions
    lc.shutdown(0,false);
    /* Set the brightness to a medium values */
    lc.setIntensity(0,8);
    /* and clear the display */
    lc.clearDisplay(0);)


    in setup or other pre-defined functions.
    IMRAN

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 5
    Points: 12,423, Level: 26
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    1,889
    Helped
    405 / 405
    Points
    12,423
    Level
    26

    Re: Programming for Display Board using Arduino+keypad+Max7221+LCD

    if your code given is executed only once , then in 1''setup".


    1 members found this post helpful.

    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 2
    Points: 3,524, Level: 13
    imranahmed's Avatar
    Join Date
    Dec 2011
    Location
    Karachi,Pakistan
    Posts
    595
    Helped
    2 / 2
    Points
    3,524
    Level
    13

    Re: Programming for Display Board using Arduino+keypad+Max7221+LCD

    Here is my code,for keypad,I want to write any number and press # as enter but in
    my program when I pressed # then # also print in LCD I do not want to print #.


    Code:
    #include 
    #include 
    
    byte inc=0;
    const byte ROWS = 4; //four rows
    const byte COLS = 3; //three columns
    char store[20];
    char keys[ROWS][COLS] = {
      {'1','2','3'},
      {'4','5','6'},
      {'7','8','9'},
      {'*','0','#'}
    };
    byte rowPins[ROWS] = {25, 24, 23, 22}; //connect to the row pinouts of the keypad
    byte colPins[COLS] = {28, 27, 26}; //connect to the column pinouts of the keypad
    
    Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
    
    LiquidCrystal lcd(35, 34, 33, 32, 31, 30);
    
    void setup() {
        
      // set up the LCD's number of columns and rows:
      lcd.begin(20, 4); 
      
    }
    
    void loop()
    {
    
      char key = keypad.getKey();  
      if(key != NO_KEY)
      {  
      store[inc] = key;
      inc++;      
      
      if(key == '#')
      lcd.print(store);
      inc=0;
      }   
    }
    IMRAN



    •   AltAdvertisment

        
       

  4. #4
    Advanced Member level 5
    Points: 12,423, Level: 26
    Achievements:
    7 years registered

    Join Date
    Apr 2010
    Posts
    1,889
    Helped
    405 / 405
    Points
    12,423
    Level
    26

    Re: Programming for Display Board using Arduino+keypad+Max7221+LCD

    ]

    what is NO_KEY ?



--[[ ]]--