This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to read port pins in port(P0,1,2)?

I would like to call function like port(P0,1,2).i want to assign the values of 0 and 1 to P0.1 and P0.2 using that function prototype only...how can i assign the values to port pins.what are the steps i need to follow...

Thanks in advance

chinnaye

Parents
  • never mind.

    check my code once

    typedef enum
    { int_pin0=0,
    int_pin1=1,
    int_pin2=2,
    int_pin3=3,
    int_pin4=4,
    int_pin5=5,
    int_pin6=6,
    int_pin7=7

    }pin1_number,pin2_number;

    void ping( unsigned char port ,pin1_number num1 ,pin2_number num2 );

    void main()
    { ping(P0,1,2);//1&2 are port pins...i.e P0_1,P0_2 like it can be changed..

    }

    remaining program which i was already post..i want to assign the values of 0 & 1 to the port pins..i didn't get it.

Reply
  • never mind.

    check my code once

    typedef enum
    { int_pin0=0,
    int_pin1=1,
    int_pin2=2,
    int_pin3=3,
    int_pin4=4,
    int_pin5=5,
    int_pin6=6,
    int_pin7=7

    }pin1_number,pin2_number;

    void ping( unsigned char port ,pin1_number num1 ,pin2_number num2 );

    void main()
    { ping(P0,1,2);//1&2 are port pins...i.e P0_1,P0_2 like it can be changed..

    }

    remaining program which i was already post..i want to assign the values of 0 & 1 to the port pins..i didn't get it.

Children