Button help


Closed Thread
Results 1 to 22 of 22

Thread: Button help

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Location
    INDIA
    Posts
    89


    Did you find this post helpful? Yes | No

    Default

    'PIC 16F84A
    DEFINE OSC 4
    TRISA = %000001
    TRISB = %11111100
    I VAR BYTE
    PAUSE 200

    MAIN:
    IF PORTA.0 = 1 then SWITCH_LED
    goto main

    SWITCH_LED: IF PORTA.0 = 0 THEN SWITCH_LED_INSTANT
    FOR I = 0 TO 10
    IF I < 10 AND PORTA.0 = 0 THEN SWITCH_LED_INSTANT
    PAUSE 100
    NEXT I
    IF PORTA.0 = 1 THEN SWITCH_LED_DELAY
    goto main

    SWITCH_LED_DELAY: TOGGLE PORTB.0
    PAUSE 10

    AVOID_LED_BLINK: IF PORTA.0 = 1 THEN AVOID_LED_BLINK
    PAUSE 10
    GOTO MAIN


    SWITCH_LED_INSTANT: TOGGLE PORTB.1
    PAUSE 10
    GOTO MAIN

  2. #2
    JARI NETWORKS's Avatar
    JARI NETWORKS Guest


    Did you find this post helpful? Yes | No

    Default

    I'm also a new one with de pic chips, can I use this also for a 16F628A chip??

    grz Jan

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    946


    Did you find this post helpful? Yes | No

    Default Melanie, I tested your piece of code

    Hello Melanie,

    Your piece of code didn't work until I... grounded PORTB.2.

    So I tried my code and it worked well too.

    I didn't expect this component to be so sensible to the electric field around the pins.

    I won't forget this lesson, for sure ;-)
    Roger

  4. #4
    JARI NETWORKS's Avatar
    JARI NETWORKS Guest


    Did you find this post helpful? Yes | No

    Default

    so many viewers, and nobody can give me an answer??

  5. #5
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JARI NETWORKS
    I'm also a new one with de pic chips, can I use this also for a 16F628A chip??

    grz Jan
    If you are meaning "can you use the button command with the 16f628a chip, then the answer is yes

  6. #6
    JARI NETWORKS's Avatar
    JARI NETWORKS Guest


    Did you find this post helpful? Yes | No

    Default

    ok thanks,that was all I want to know at this moment

Similar Threads

  1. Sony SIRC IR Issue
    By Ryan7777 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 8th August 2015, 09:10
  2. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 03:43
  3. Code check -- button not working
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 2nd March 2006, 23:43
  4. Button Push within 3 second Window
    By Tissy in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 22nd December 2005, 11:06
  5. Button subfunction 16F628
    By Jųan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2005, 17:44

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