AELEXIAN EMPIRE
Would you like to react to this message? Create an account in a few clicks or log in to continue.

0-999 DIGITAL COUNTER

5 posters

Go down

0-999 DIGITAL COUNTER Empty 0-999 DIGITAL COUNTER

Post by Digitap Fri Sep 03, 2010 6:20 pm

Posted by ultrasonic™ on June 25, 2009 at 3:07am

0-999 DIGITAL COUNTER 2_272450324l

Digitap
Digitap
Admin
Admin

Posts : 927
Join date : 2010-09-03
Age : 32
Location : Makati City

Back to top Go down

0-999 DIGITAL COUNTER Empty Re: 0-999 DIGITAL COUNTER

Post by samarnathdev@yahoo.com Thu Apr 25, 2013 3:29 pm

how can mul by signe byte to un signe byte for 8051
.
samarnathdev@yahoo.com
samarnathdev@yahoo.com
AAA Battery
AAA Battery

Posts : 1
Join date : 2013-04-25

Back to top Go down

0-999 DIGITAL COUNTER Empty Re: 0-999 DIGITAL COUNTER

Post by james Thu Apr 25, 2013 9:17 pm

Di ko maintindihan ang lengwahe dito.
james
james
24V BATTERY
24V BATTERY

Posts : 1081
Join date : 2011-11-14

Back to top Go down

0-999 DIGITAL COUNTER Empty Re: 0-999 DIGITAL COUNTER

Post by ultrasonic™ Sat Apr 27, 2013 6:42 pm

mul means multiplex cguro... 8051 hmmpppfff diba mcu nato?
so hands down nko, bsta my knalaman sa programmng (^_^

btw.. na wash out din pla ang diag nito...


_________________
6th member of STTM
former 2nd member


im always walking on the rain so that no one could see me crying
ultrasonic™
ultrasonic™
24V BATTERY
24V BATTERY

Posts : 4475
Join date : 2010-08-19
Age : 38
Location : Davao City

Back to top Go down

0-999 DIGITAL COUNTER Empty Re: 0-999 DIGITAL COUNTER

Post by redskin61 Fri Jan 03, 2014 7:46 pm

0-999 DIGITAL COUNTER <a href=0-999 DIGITAL COUNTER 4digitcounter" />

once again an old thread. thinking somebody may have a use for this code.

Device=16F84
Symbol Segments = PORTB
Symbol Digits = PORTA

Dim i As Byte
Dim n As Byte
Dim m As Byte
Dim Value As Word


TRISB = $80 ' Set segment pins to output
TRISA = $f0 ' Set digit pins to output

mainloop:

For Value = 0 To 9999
   GoSub display ' Display the value
       Next Value
   GoTo mainloop ' Do it forever

' Subroutine to send the number (0 - 9999) in Value to LEDs
display:
   m = m + 1      
   
   For i = 0 To 3 'Loop through 4 digits
       n = Value Dig i 'Get digit to display
                        'DIG returns the value of a decimal digit. Simply tell it
                        'the digit number (0 - 4 with 0 being the rightmost digit)
                        'you would like the value of, and voila.
   
   GoSub display1     'Display the digit
   DelayMS 1       'Leave it on 1 millisecond
   Next i ' Do next digit

' This code will display each count 100 times before incrementing to the next value
   If m <> 100 Then
   GoTo display
   EndIf
   m = 0
   Return    'Return from subroutine. RETURN resumes execution at the statement
             'following the GOSUB which called the subroutine


' Surboutine to display one digit on LED
'  i = digit number
'  n = number to display
display1:
   Digits = $00 ' All digits off to prevent ghosting
   

' Convert binary number in n to segments for LED
Segments = LookUp n, [$40, $79, $24, $30, $19, $12, $02, $78, $00, $18]

' Set digit pin i to 1 (on) and the rest of the pins to 0 (off)
Digits = Dcd i 'ex. if i=2, Digits = 0100
                'DCD returns the decoded value of a bit number. It changes a
                'bit number (0 - 15) into a binary number with only that bit
                'set to 1. All other bits are set to 0.

Return     'Return from subroutine. RETURN resumes execution at the statement
              'following the GOSUB which called the subroutine
redskin61
redskin61
AAA Battery
AAA Battery

Posts : 10
Join date : 2014-01-03

Back to top Go down

0-999 DIGITAL COUNTER Empty Re: 0-999 DIGITAL COUNTER

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum