Go Down

Topic: code for display numbers atseven segment display using 4x4 keypad, decoder 7447 (Read 2098 times) previous topic - next topic

hi I am new in arduino too, and i want to display numbers 0 to 9, in a 7-segment display using keypads (4x4) and arduino, please let me know if somebody can help me thank you.

PeterH

I only provide help via the forum - please do not contact me for private consultancy.

AMPS-N


SIMPLE CODE THAT MIGHT ANSWER YOUR QUESTION

Code: [Select]



byte seven_seg_digits[10][7] = { { 1,1,1,1,1,1,0 },  // = 0
                                                           { 0,1,1,0,0,0,0 },  // = 1
                                                           { 1,1,0,1,1,0,1 },  // = 2
                                                           { 1,1,1,1,0,0,1 },  // = 3
                                                           { 0,1,1,0,0,1,1 },  // = 4
                                                           { 1,0,1,1,0,1,1 },  // = 5
                                                           { 1,0,1,1,1,1,1 },  // = 6
                                                           { 1,1,1,0,0,0,0 },  // = 7
                                                           { 1,1,1,1,1,1,1 },  // = 8
                                                           { 1,1,1,0,0,1,1 }   // = 9
                                                           };

void setup() {               
  pinMode(2, OUTPUT); 
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  writeDot(0);  // start with the "dot" off
}

void writeDot(byte dot) {
  digitalWrite(9, dot);
}
   
void sevenSegWrite(byte digit) {
  byte pin = 2;
  for (byte segCount = 0; segCount < 7; ++segCount) {
    digitalWrite(pin, seven_seg_digits[digit][segCount]);
    ++pin;
  }
}

void loop() {
  for (byte count = 10; count > 0; --count) {
   delay(1000);
   sevenSegWrite(count - 1);
  }
  delay(4000);
}


AMPS

hi this works for seven segmen display, buy what i need to do is, when a press number 1 in my keypad 4x4 y need the same number in my seven segment display , if i press 2 i need the number 2 in m in my seven segment display and i need to do the same thing from 0 to 9.
What i have to use is 4x4 keypad, decoder 7447, and seven segment display.
thank you for all your help.

I need to do is, when a press number 1 in my keypad 4x4 y need the same number in my seven segment display , if i press 2 i need the number 2 in m in my seven segment display and i need to do the same thing from 0 to 9.
What i have to use is 4x4 keypad, decoder 7447, and seven segment display.
thank you for all your help.

Nick Gammon

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

- Moderator
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy