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.

a code programming of digital clock??

Status
Not open for further replies.

hawkhigh

Newbie level 3
Joined
Nov 29, 2012
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
Hello every body

i have a project of digital clock by BASIC STAMP MICROCONTROLLER ,,,, but i have a problem in the programming..

could you please repeat me with code of this programming
and i am using this type of 7 segment

window-316.jpg

please repeat me








my email : hawkhigh-7@hotmail.com :grin:
 


Where is your circuit?

What uC you using?

From that picture we see only 7-seg display module of 4-digit, several wires and resistors on protoboard.

and try to write with normal size font.
 

Hi
thanks Mr.Tahmid
it was something helpful ....

the circuit what i am using is not the problem
but code is the problem
see i made this code programming..for this type of 7 segment and that 7 segment is (HS-5463AS) type

now this the code is it right what i did

Code:
' What's a Microcontroller - DisplayDigits.bs2
' Display the digits 0 through 9 on a 7-segment LED display.
'{$STAMP BS2}
'{$PBASIC 2.5}

main:

seconds1   VAR Byte
seconds2   VAR Byte

counter  VAR Byte



seconds1=0
seconds2=0

OUTL = %00000000 ' OUTH initialized to low.
DIRL = %11111111 ' Set P0-P15 to all output-low.
OUTH = %00000000 ' OUTH initialized to low.
DIRH = %11111111 ' Set P0-P15 to all output-low.



DO
FOR seconds2=0 TO 5 STEP 1
FOR seconds1=0 TO 9  STEP 1
LOOKUP seconds1, [ %11100111, %10000100, %11010011,
%11010110, %10110100, %01110110,
%01110111, %11000100, %11110111, %11110110 ], OUTH
LOOKUP seconds2, [ %11100111, %10000100, %11010011,
%11010110, %10110100, %01110110,
%01110111, %11000100, %11110111, %11110110 ], OUTL
PAUSE 60000   ' for minuts 60000 for seconds 1000 for hours 1200000
NEXT
seconds1=0
NEXT
seconds2=0
LOOP
END




GOSUB ledones
GOSUB ledtens


ledtens:
DEBUG "led 1 from 0 to 9!"

' Digit:
' BAFG.CDE


OUTL = %11100111 ' 0
PAUSE 1000
OUTL = %10000100 ' 1
PAUSE 1000

OUTL = %11010011 ' 2
PAUSE 1000
OUTL = %11010110 ' 3
PAUSE 1000
OUTL = %10110100 ' 4
PAUSE 1000
OUTL = %01110110 ' 5
PAUSE 1000
OUTL = %01110111 ' 6
PAUSE 1000
OUTL = %11000100 ' 7
PAUSE 1000
OUTL = %11110111 ' 8
PAUSE 1000
OUTL = %11110110 ' 9
PAUSE 1000
DIRL = %00000000 ' I/O pins to input,
' segments off.
RETURN

ledones:

DEBUG "led 2 from 0 to 9!"
OUTH = %00000000 ' OUTH initialized to low.
DIRH = %11111111 ' Set P0-P15 to all output-low.
' Digit:
' BAFG.CDE
OUTH = %11100111 ' 0
PAUSE 1000
OUTH = %10000100 ' 1
PAUSE 1000

OUTH = %11010011 ' 2
PAUSE 1000
OUTH = %11010110 ' 3
PAUSE 1000
OUTH = %10110100 ' 4
PAUSE 1000
OUTH = %01110110 ' 5
PAUSE 1000
OUTH = %01110111 ' 6
PAUSE 1000
OUTH = %11000100 ' 7
PAUSE 1000
OUTH = %11110111 ' 8
PAUSE 1000
OUTH = %11110110 ' 9
PAUSE 1000
DIRH = %00000000 ' I/O pins to input,
' segments off.

RETURN
END



and i want show the minutes and hours
thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top