Help with Embedded Design: Push Buttons & 7 Segment Displays

  • Thread starter Thread starter Ian_Brooks
  • Start date Start date
  • Tags Tags
    Design
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 3K views
Ian_Brooks
Messages
127
Reaction score
0

Homework Statement



I'm very new to embedded design and wanted to develop a micro controller code that

*takes 3 inputs from 3 push buttons
- hundreds, tens, ones respectively
* displays the output on 3 7segment displays
* outputs a fixed binary number to another microcontroller / or perhaps use it for another aspect inside the microcontroller.


Homework Equations



None that I know of.
I'll most likely program it in C and use the ctoasm function to convert it into assembly

The Attempt at a Solution



This is the design I'm hoping for.
http://img228.imageshack.us/img228/9088/sampledesigndv7.gif

rough pseudo code for now

Code:
int hundreds, tens, ones;

boolean set = 0; // when pressed the final value is calculated and stored
boolean input1 = 0;
boolean input2 = 0;
boolean input3 = 0;

while (set != 1) {
  if (input1 == 1){
    BCDOUT_1(hundreds++);
  }
  else if (input2 == 1){
   BCDOUT_2(tens++); 
  }
  else if (input3 == 1){
   BCDOUT_3(ones++);
  }

}//end while - loop ends when set = 1

finalVal = (100*hundreds) + (10*tens) + ones;

things to include:
i'll have to #define the push button addresses
in the main code I'll have to define the output ports as

byte *output_port = (byte *) display; //or something or rather

could someone help - or atleast point me in the right direction
 
Last edited by a moderator:
Physics news on Phys.org
Which micro depends on how many you want to make.
A basic stamp or pic is easiest is you only want one or two, if you are making more then something like an 8051, but the dev kit is expensive for one off.
It is unlikely you will find a low end micro with enough i/o pins to drive 3 x 7segment directly, you probably need an interface chip to run the display.