C for PIC16f877

Discussion in 'Embedded Systems and Microcontrollers' started by haoyan, Apr 26, 2007.

  1. haoyan

    Thread Starter New Member

    Apr 26, 2007
    3
    0
    I am doing a project that use a pushbutton to control the value of the output. When the user push the button for while the counter will increase the value when release the button the value stop to change. The code as follow:

    void intial()
    {
    TRISB=0x01;
    }

    void main()
    {
    intial();
    while(1)
    {
    do{
    count++;
    } while(RB1=1)
    }

    and then the value will show on the LCD. I am a beginner of the PIC program, is any one can help me to complete the code?


    Thank you
     
Loading...