Lcd Module Display 2 line 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 = 7
SW1  VAR PORTA.0
SW2  VAR PORTA.1
num var byte      
LCDOUT $FE,1,"lcd_read" 
pause 3000
main:

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

set_value:
    if(!sw1) then 
      pause 150
      if(num>255)then
        num=0
      else 
       num=num+1
      endif
    else
     if(!sw2) then 
      pause 150
      if(num<0)then
        num=254
      else 
       num=num-1
      endif   
    else
    endif
    endif 
return




Leave a Comment

*
= 4 + 9

Read previous post:
SMD Soldering Reflow Oven (ControLeo2 based)
SMD Soldering Reflow Oven (ControLeo2 based)

I'm sure you've seen a ton of these by now. If you are a maker then this is one tool...

Close
Scroll to top