+ Post New Thread
Results 1 to 3 of 3
  1. #1
    Newbie level 4
    Points: 656, Level: 5

    Join Date
    Jan 2010
    Location
    USA
    Posts
    7
    Helped
    0 / 0
    Points
    656
    Level
    5

    PIC12F683 GPIO pin reading problem

    Hello,

    I am building a very small circuit with PIC12F683 which will drive two small 5V relays from its timers.
    The time interval will depend on the one of 4 settings on DIP Switch connected to GP4 and GP5 (GP4 = Switch0 and GP5 = Switch1).
    I am using HI-Tech PICC compiler Lite Version (9.83).

    I am having syntax problems at "IF{ " when compiling the following lines:


    // Main loop
    while(1)
    {

    //Read Input Switches
    //SW1 SW0
    // 00 = AUTO MODE with PIR
    // 01 = Fix Mode: Shot every 10 Sec
    // 10 = Fix Mode: Shot every 30 Sec
    // 11 = Fix Mode: Shot every 1 Minute

    // Read the DIP switch settings

    If(SW1==0 && SW0==0){
    // AUTO MODE
    // This would be external interrupt trigger driven code
    // Turn Power ON
    // POWER = 1;
    // Delay 3 usec
    __delay_ms(3000);
    // Take a shot
    // SHOOT = 1;
    // Wait for it to be saved on the SD Card
    __delay_ms(3000);
    }

    Thank you for your help.

    •   AltAdvertisment

        
       

  2. #2
    Advanced Member level 3
    Points: 7,837, Level: 21
    milind.a.kulkarni's Avatar
    Join Date
    Oct 2011
    Location
    Bangalore
    Posts
    923
    Helped
    215 / 215
    Points
    7,837
    Level
    21
    Blog Entries
    1

    Re: PIC12F683 GPIO pin reading problem

    i think it is case sensitive you type "IF" mostly you need try typing... "if"

    Good Luck
    Hope the post will be helpful to you....
    "Sharing is the best way of Learning"



    •   AltAdvertisment

        
       

  3. #3
    Newbie level 4
    Points: 656, Level: 5

    Join Date
    Jan 2010
    Location
    USA
    Posts
    7
    Helped
    0 / 0
    Points
    656
    Level
    5

    Re: PIC12F683 GPIO pin reading problem

    Quote Originally Posted by milind.a.kulkarni View Post
    i think it is case sensitive you type "IF" mostly you need try typing... "if"

    Good Luck
    Thanks but if you see in the code I posted it is actually written as "if"



--[[ ]]--