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.

Please help me i am in a great trouble

Status
Not open for further replies.

sujayjoardar

Newbie level 1
Joined
Aug 3, 2012
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,291
Sir/Madam,
i am trying to make a score board circuit for a gaming device, which has 3 holes, and each of the hole containing different point, i just want to calculate the total score at the end.It is a 10 ball game
each time it will drop onto a single hole and display a single value, but at the end of 10th ball, it will sum up the total score and display the total value.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include<regx51.h>
 
#define int s[k]={1 2 3};
 
sbit out1=P0^1;
sbit out2=P0^2;
sbit out3=P0^3;
 
void main()
 
 {
 
  int i;
  
  int t=0;
 
while(1)
{
  
  for(i=0;i<10;i++)
 
  {
    if(out1==0)
    t=t+s[1];
 
    else if(out2==0)
    t=t+s[2]
    
    else if(out3==0)
    t=t+s[3];
 
    else
    t=t;
 
  }
 
  }
 
  }

 
Last edited by a moderator:

which MCU you are using which ports are using,what abut config bits, nothing you mentioned???
 

Your hardware is not so difficult to make. You should use some sensors. I do not know how did you designed it. I you can tell me details idea I may help you to make it.
Regards
Hasan
 

Change
Code:
 #define int s[k]={1 2 3};
to
Code:
 int s[3] = {1, 2, 3};
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top