Basic Toggle Control For Basic PRO Compiler

@ device  PIC16F877 
define osc 4
define adc_bits 8
main:

    trisb =$00
    trisa =$ff
    adcon1 = 7
    lamp   var portb.0
    sw1    var porta.0 
    lamp=0  

while(1)  
     if(!sw1) then 
        pause 10     
        toggle lamp
        while(!sw1):wend 
     endif
     pause 10   
wend 
end

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Follow Us:
LinkedinTwitter