multiple outputs on....


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2007
    Posts
    3

    Default multiple outputs on....

    I am new to programming with picBasic Pro. I have used the parallax version. Here is the trouble I am having....
    I want to sequence 2 outputs, triggered by a push button. In words, this is what i want to happen:
    if button is pressed
    turn on 1st output
    wait half a second
    turn on 2nd output (1st output must stay on)
    wait half a second
    turn 2nd output off
    wait 3 seconds
    turn 1st output off

    my coding goes like this:

    main:
    if portb.6 = 1 then
    goto activate
    else
    high portc.0
    endif
    goto main

    activate:
    high portc.0
    pause 500
    high portc.1
    pause 500
    low portc.1
    pause 3000
    low portc.0
    goto main
    end

    it works fine, except portc.0 shuts itself off when i call portc.1 high. I have tried a variety of simple programs, but can only get one output on at a time.
    What am I doing wrong? Basic Stamp editor holds the output high until it is instructed to move it low.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,648


    Did you find this post helpful? Yes | No

    Question

    Hi, Rick

    What processor do you use ???

    Alain
    ************************************************** ***********************
    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 " !!!
    *****************************************

  3. #3
    Join Date
    Nov 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Hi Alain

    I am using a pic16F690.
    Any help will be greatly appreciated.
    R

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


    Did you find this post helpful? Yes | No

    Post

    Hi,

    First, try to configure PORTC digital pins as you need ... ANSEL = % xxxx xxxx see µChip databook

    Try also to define explicitly your I/Os by using TRISx = % xxxx xxxx , I know PbP is supposed to care with that .... but, you'll be SURE of !!!

    Alain

    PS : no need to "bomb" the forum ... one thread is enough !!!
    ************************************************** ***********************
    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. Multiple PICS from Same Crystal?
    By WOZZY-2010 in forum General
    Replies: 2
    Last Post: - 6th February 2010, 15:18
  2. 30 PWM outputs on one chip?
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th September 2009, 16:32
  3. help with multiple outputs...
    By rickvan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th November 2007, 17:34
  4. Problems controlling multiple pics
    By gandora in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 29th May 2007, 08:59
  5. Multiple IR LEDs from 1 port using transistor
    By belpe123 in forum General
    Replies: 3
    Last Post: - 20th May 2005, 22:07

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