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 ...

Read more

Seven segment display 4 digit for shift 595 For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 Include "MODEDEFS.bas" DEFINE ADC_SAMPLEUS 100 DEFINE SHIFT_PAUSEUS 100 ADCON1 = 7 TRISA =$ff trisb =$00 '=======output=======' dat vAR portb.0 clk vAR portb.1 latch vAR portb.2 relay VAR portb.3 '======input=========' enter vAR porta.0 chg VAR porta.1 hour var byte minute var byte second var byte prsc1 var byte i var byte num var word num2 var word num3 var ...

Read more

Seven segment display 4 digit For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 adcon1 = 7 trisa = $ff trise = $00 trisc = $00 trisd = $00 digit var byte num var word disp var byte num =00 while(1) digit = num dig 0 lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp portd = disp high portc.0 pause 5 low portc.0 digit = num dig 1 lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp portd = disp high portc.1 pause 5 low po ...

Read more

Seven segment _2digit_cathode For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 adcon1 = 7 trisa = $ff trise = $00 trisc = $00 trisd = $00 digit var byte num var byte disp var byte num =00 loop: digit = num dig 0 lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp portd = disp high porte.0 pause 5 low porte.0 digit = num dig 1 lookup digit,[$3f,$06,$5b,$4f,$66,$6d,$7d,$07,$7f,$6f],disp portd = disp high porte.1 pause 5 low porte ...

Read more

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 paus ...

Read more

Wye-delta Motor Controll For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 K1 var portb.0 K2 var portb.1 K3 var portb.2 start var porta.0 stops var porta.1 K1=0 :K2=0:k3=0 while(1) if(!start and stops) then K1=1 K2=1 K3=0 pause 3000 repeat K1=1 K2=0 K3=1 until(!stops) endif K1=0 K2=0 K3=0 pause 10 wend end ...

Read more

Shift left – shift right value For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 lamp var portb sw1 var porta.0 sw2 var porta.1 lamp=0 while(1) if(!sw1) then gosub speed1 pause 50 endif if(!sw2) then gosub speed2 pause 50 endif pause 10 wend end speed1: lamp =$80 pause 200 while(sw2) lamp = lamp >> 1 ' shift right if lamp = $00 then lamp = $80 pause 200 wend return speed2: lamp =$01 pause 200 ...

Read more

Sound frequency For Basic PRO Compiler

@ device pic16f877 define osc 4 define adc_bits 8 main: trisb =$00 trisa =$ff adcon1 = 7 speaker var portb.0 sw1 var porta.0 flg_set var bit speaker =0 flg_set =0 while(1) if(!sw1) then pause 150 toggle flg_set while(!sw1):wend endif gosub sounds pause 10 wend end sounds: if(flg_set)then pause 10 sound speaker,[100,10]'100 =(1-127 generate frequency 78.74-10 khz ) '10 = constant time 12ms/1 = 120 ms else so ...

Read more
Scroll to top