Pages: [1]   Go Down
Author Topic: code for display numbers atseven segment display using 4x4 keypad, decoder 7447  (Read 1476 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: December 10, 2012, 04:59:53 pm by jc7molina » Logged

UK
Offline Offline
Shannon Member
****
Karma: 222
Posts: 12562
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What help do you need?
Logged

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

DELHI
Offline Offline
God Member
*****
Karma: 7
Posts: 738
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


SIMPLE CODE THAT MIGHT ANSWER YOUR QUESTION

Code:


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

 
Logged

AMPS

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* 20121210_115743.jpg (1676.89 KB, 3264x2448 - viewed 97 times.)
« Last Edit: December 10, 2012, 04:38:25 pm by jc7molina » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* 20121210_115743.jpg (1676.89 KB, 3264x2448 - viewed 43 times.)
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Threads merged.

- Moderator
Logged

Pages: [1]   Go Up
Jump to: