Input problems with 12F629?


Results 1 to 14 of 14

Threaded View

  1. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default Re: syntax for loop delay with 12F629?

    This one should work ... ( ISIS tells so ... )

    Code:
    '****************************************************************
    '*  Name    : SERVOTEST0                                        *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2013 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 10/02/2013                                        *
    '*  Version : 1.0                                               *
    '*  Notes   : 12F629 @4 Mhz internal                            *
    '*          :                                                   *
    '****************************************************************
    
    #CONFIG
       __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _CP_OFF & _MCLRE_OFF
    #ENDCONFIG
    
    Servo   var GPIO.0
    Right   var GPIO.1
    Left    var GPIO.2
    
    Define OSCCAL_1K 1 
    CMCON   =7 ' disable analog comparator
    ' ansel=0  NO ANSEL with the '629 !!!...
    TRISIO  = %11111110 ' set GPIO as output
                     ' others as input
    i VAR BYTE
    clear 
    
    low Servo
    pause 100
    
    ' commented outloop:
    main:
    
    while 1
        IF Right THEN
            pulsout Servo, 147
        ELSEIF Left THEN
            PULSOUT Servo, 152
        ELSE
            PULSOUT Servo, 150  ' Center/stop ( ? ) if no button pushed ...   
        ENDIF
        
        Pause 19
        
    WEND
           
    end
    Alain
    Last edited by Acetronics2; - 10th February 2013 at 15:12.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  2. Input problems
    By ALFRED in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 23rd July 2006, 21:02
  3. Using GPIO.3 as input on 12F629
    By Sharky in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th May 2006, 19:41
  4. Input on 12F629
    By BGreen in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th March 2005, 11:14
  5. 12F629 I2C problems
    By AIW128ProGuy in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th November 2004, 23:41

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts