Seven segment _2digit_anode For Basic PRO Compiler

@ device pic16f877
define osc 20
define adc_bits 8
adcon1 = 7
trisa = $ff
trise = $00
trisc = $00
trisd = $00

digit   var     byte 
num     var     byte
disp    var     portd
num =12
loop:        
      gosub display                                                                    
     goto loop
end 

display:

      digit = num dig 0
      lookup digit,[$40,$79,$24,$30,$19,$12,$02,$78,$00,$10],disp         
      high porte.0 
      pause 1   
      low porte.0                    
        digit = num dig 1
        lookup digit,[$40,$79,$24,$30,$19,$12,$02,$78,$00,$10],disp          
        high porte.1 
        pause 1  
        low porte.1

      if(num>99) then 
         num=0 
      else 
       num =num+1  
      endif
      pause 200 
 return

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter