Thread Status:
Not open for further replies.
  1. kkbanton

    Thread Starter New Member

    Jan 20, 2011
    10
    0
    Good day guys!

    I have my PIC16f877A with a 4x3 keypad as an input, LCD and 8LEDs as my output. I can already display my outputs on LCD and 8LEDs. And I also interfaced a potentiometer in RA1 as an analog input and I just want to control the delay of the 8LEDs using the analog potentiometer but I don't know how. Do you have some ideas? Thanks in advance.:)
     
  2. DumboFixer

    Active Member

    Feb 10, 2009
    219
    34
  3. kkbanton

    Thread Starter New Member

    Jan 20, 2011
    10
    0
    Thanks DumboFixer. I already have that 0-1023 value. But how will the programs flows? I'm using Proton and here is my current program on that. Thanks.

    LEDTEST:
    Print At 1,1, " LED TEST "
    Print At 2,1, "[1]Running [4]Blink "
    Print At 3,1, "[2]Meeting [5]Step "
    Print At 4,1, "[3]Alternating #-Esc"
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo MAIN
    If NUMERIC = 1 Then GoSub BEEP : GoTo RUN
    If NUMERIC = 2 Then GoSub BEEP : GoTo MEET
    If NUMERIC = 3 Then GoSub BEEP : GoTo ALTERNATE
    If NUMERIC = 4 Then GoSub BEEP : GoTo BLINK
    If NUMERIC = 5 Then GoSub BEEP : GoTo STEF
    GoTo LEDTEST

    RUN:
    Print At 1, 1, " LED TEST "
    Print At 2, 1, "--------------------"
    Print At 3, 1, " RUNNING LIGHTS "
    Print At 4, 1, " #-Esc"
    GoTo RUNNING

    RUNNING:
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED1
    DelayMS 200
    Low LED1
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED2
    DelayMS 200
    Low LED2
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED3
    DelayMS 200
    Low LED3
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED4
    DelayMS 200
    Low LED4
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED5
    DelayMS 200
    Low LED5
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED6
    DelayMS 200
    Low LED6
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED7
    DelayMS 200
    Low LED7
    DelayMS 200
    GoSub KEYPAD
    If NUMERIC = 12 Then GoSub BEEP : GoTo LEDTEST
    High LED8
    DelayMS 200
    Low LED8
    DelayMS 200
    GoTo RUNNING
     
  4. DumboFixer

    Active Member

    Feb 10, 2009
    219
    34
    Can we please close this as it is being discussed elsewhere
     
  5. bertus

    Administrator

    Apr 5, 2008
    15,646
    2,344
Thread Status:
Not open for further replies.