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

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.