Analog to dugital 8 bits For Basic PRO Compiler

@ device pic16f877
define  osc 4
define  adc_bits 8
Define  LCD_DREG   PORTD   ' Define LCD connections
Define  LCD_DBIT   4
Define  LCD_RSREG  PORTD
Define  LCD_RSBIT  1
Define  LCD_EREG   PORTD
Define  LCD_EBIT   0 
RW      var        portd.2
low     RW         'LCD R/W low = write
trisa = $ff 
trisd = $00  
adcon1 = 0 
num var byte      
LCDOUT $FE,1,"lcd_read" 
pause 3000
main:

    gosub read_value 
    gosub display
    pause 200
	GoTo main	
End
display:   
    LCDOUT $FE,$80," setting value  "
	Pause 20
	LCDOut $FE,$C0,"temp_set1=",dec3 num ," 'C" 
	Pause 20

return	

read_value:
    adcin 0,num
    pause 10    
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