Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Status
Not open for further replies.

imranahmed

Advanced Member level 3
Joined
Dec 4, 2011
Messages
817
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
6,492
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.
 

if your code given is executed only once , then in 1''setup".
 
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 <LiquidCrystal.h>
#include <Keypad.h>

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;
  }   
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top