push button problem


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120

    Default push button problem

    hello boys and girls,

    I am using pic16F627 20Mhz.I have 3 push buttons conected in :
    porta.2-->MOVE LEFT
    porta.3-->UP
    porta.4-->DOWN
    I have 8 dot matrix leds connected with my pic.I want pressing 1 time the putton in porta.2 to do changes in the first led UP or DOWN,pressing two times changes to the second led...
    The adresse of the of the first led is SerData[2],second SerData[3]...last SerData[9].


    .................................................. ..................
    i = 1
    STATIC:
    BUTTON PORTA.2,1,250,250,B0,0,main
    i = i + 1
    BUTTON PORTA.3,1,250,250,B0,1,INCREASE
    BUTTON PORTA.4,1,250,250,B0,1,DECREASE
    GOTO MAIN

    INCREASE: ASCII = ASCII+1
    IF ASCII > 127 THEN ASCII = 0
    SerData[i] = ASCII
    GOSUB OUT
    GOTO STATIC
    DECREASE: ASCII = ASCII-1
    IF ASCII > 127 THEN ASCII = 0
    SerData[i] = ASCII
    GOSUB OUT
    GOTO STATIC

    .................................................. ...................................

    Somethinf is not working propertly!!
    Any idea
    Thanks

    Nikos Geronikolos

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Nger,

    Nger>>Somethinf is not working propertly!!
    Any idea<<

    First of all...What is the beginning value of ASCII??? Zero?? Random number?. Maybe assign ASCII a value of dec 42 first (I believe that is the number "0").

    I see increase, I see decrease, and I see static... But I do not see the label for main. Should it be where static is?

    Arrays start with zero, not one. Thus I=0 probably should be the correct starting number. (Instead of "1").


    Where do you output your data? Do not see this either. Unless there are other hidden things I am not aware of <g>.



    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Button problem driving me crazy!! Please help!
    By bearpawz in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 20th November 2007, 14:46
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 22:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 10:06
  5. Push Button 'Menu' to Choose Variable.
    By Tissy in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th March 2005, 07:00

Members who have read this thread : 1

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