Need help in code


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    camolas,

    Do you have a schematic you could post?
    Dave
    Always wear safety glasses while programming.

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    camolas,

    Do you have a schematic you could post?
    Yes i have please see it. (i put 2 bottuns but with a good code one i think can do the jobe)

    Thanks
    Attached Images Attached Images  
    Last edited by camolas; - 17th April 2008 at 23:51. Reason: forget te tell more things

  3. #3


    Did you find this post helpful? Yes | No

    Talking

    Hi,

    Just solve it now and with only one pushbutton

    Code:


    @ DEVICE pic16F877A, WDT_ON ' Watchdog Timer
    @ DEVICE pic16F877A, PWRT_ON ' Power-On Timer
    @ DEVICE pic16F877A, BOD_ON ' Brown-Out Detect
    @ DEVICE pic16F877A, LVP_OFF ' Low-Voltage Programming
    @ DEVICE pic16F877A, CPD_OFF ' Data Memory Code Protect
    @ DEVICE pic16F877A, PROTECT_OFF ' Program Code Protection
    @ DEVICE pic16F877A, WRT_OFF ' Flash Memory Word Enable

    TRISB.0=1
    TRISC.7=0

    LED var PORTC.7
    Bot1 var PORTB.0

    CMCON=%00000111 ' Disable Comparators
    CVRCON=%00000000 ' Disable Reference Module
    OPTION_REG.7=0 ' Enable Weak Pull-Up's


    ini:
    Low LED
    WHILE Bot1=0 :WEND
    PAUSE 10000
    high LED
    PAUSE 300
    Low LED
    GOSUB FIM

    FIM:
    WHILE Bot1=1 :WEND
    GOTO ini
    End



    Thanks you all

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


    Did you find this post helpful? Yes | No

    Wink

    Hi, Camolas

    Code:
    ...
    
    GOSUB FIM
    
    FIM:
    WHILE Bot1=1 :WEND 
    GOTO ini
    
    ...
    Those two lines ( GOSUB FIM and FIM: ) can be simply wiped off : the only use is to loose two clock cycles ... say nothing for us.


    " Im Portugese next Europen winers cup"

    too much ... vinho verde ???


    Alain
    Last edited by Acetronics2; - 18th April 2008 at 09:17.
    ************************************************** ***********************
    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 " !!!
    *****************************************

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Camolas

    Code:
    ...
    
    GOSUB FIM
    
    FIM:
    WHILE Bot1=1 :WEND 
    GOTO ini
    
    ...
    Those two lines ( GOSUB FIM and FIM: ) can be simply wiped off : the only use is to loose two clock cycles ... say nothing for us.


    " Im Portugese next Europen winers cup"

    too much ... vinho verde ???


    Alain
    Hi,

    I will try that later.

    About the vinho verde not at all for the moment

  6. #6


    Did you find this post helpful? Yes | No

    Default

    Thanks for the hellp Alain, when you came to Prtugal i will buy you a botle of vinho verde.

    Im from the city that mackes the bert Portugese vinho verde Casal Garcia, Aveleda...

    By by

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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