Output stays high


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2009
    Posts
    6

    Default Output stays high

    Hi,

    I am working on a program with 3 switches and 3 LED's.
    Every switch is connected to 1 LED.

    what i want, is that when i push Switch1, LED1 must go on but when i release the button LED1 must stay high until i pressed Switch2 again.

    can someone help me?

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


    Did you find this post helpful? Yes | No

    Lightbulb

    Hi, Ozzie

    This is a pure logic question ... but your problem is not clearly enough explained : no " cooked " solution available with so little detail given ...


    so, you could have a look here :

    http://karnaugh.shuriksoft.com/

    this would help you to write

    Led1 = Button1 + ? ....
    Led2 = Button2 + ? ...
    Led3 = Button 3 ...


    Now you also can try to do it the " hard way " using some SELECT CASE statement ... lazy boy solution !!!

    looks some school homework , no ???

    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
    Apr 2009
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Ozzie

    This is a pure logic question ... but your problem is not clearly enough explained : no " cooked " solution available with so little detail given ...


    so, you could have a look here :

    http://karnaugh.shuriksoft.com/

    this would help you to write

    Led1 = Button1 + ? ....
    Led2 = Button2 + ? ...
    Led3 = Button 3 ...


    Now you also can try to do it the " hard way " using some SELECT CASE statement ... lazy boy solution !!!

    looks some school homework , no ???

    Alain
    yess it is for a project at school, well i will try to explain what i want..

    basicly it is:

    if button1 is pressed once LED1 must go on and stay on until button 2 is pressed
    if button 2 is pressed once LED1 must go of and LED2 must go on until button 3 is pressed
    if button 3 is pre......

    thanks

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


    Did you find this post helpful? Yes | No

    Angry

    May I state it's YOUR exercise to define what has to be done for wich input combination ...

    AND we're supposed to help for programming the PIC application ...

    In short words :

    The logics problem is yours ... not ours to solve.

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

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  4. sample code for M25P32
    By Pedro Santos in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th January 2007, 02:37
  5. Serin and TMR0
    By capitano in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th May 2006, 14:58

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