Shop OBEX P1 Docs P2 Docs Learn Events
INEX-1000. Real newbee question — Parallax Forums

INEX-1000. Real newbee question

ArchiverArchiver Posts: 46,084
edited 2001-07-22 10:17 in General Discussion
Just got a few days ago a INEX-100 from my father.
Trying to figure out the schematics of the Scott Edwards Book "Prog.
& custom. the BS comp.".
I just wonna make an easy AND instruction with two switches which
will light a LED in the AND configuration. But, the light is on when
the button switches are open and when pressing 1 of the 2 buttons,
the lights goes out. I had to change the AND to OR and then the
lights goes out when pressing the two buttons together. It is not
possible to change the ground of the LED on the INEX-100 board (which
is different then the drawing in the book, page 79).
I think it is right to state that when an output goes high it "sends"
a 5 V signal out and when it is low it sends a "grounded" signal (-).
Is there a command that can changes (invert) a logic 1 (input)to a 0?
Or is there another mutch easier solution. I tried almost 3 hours to
change the way of working.
Thanks.
Tim.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-07-22 10:17
    Hi Tim,

    The led on the INEX is turned by outputting a 1 on a stamp pin.
    The switches read a 0 when they are pressed, so they have a pullup resistor.
    Lets define those states.

    Switchopen con 1 'normally open switches with pullup resistors, switches
    close to GND
    Switchclose con 0
    Ledon con 1 'led plus series resistor between pin (anode) and GND (cathode)
    Ledoff con 0

    Switch1 var in1 'switch on pin1
    Switch2 var in2 'switch on pin 2
    Led var out0 'led on pin0

    Led = ledoff
    Output 0 'make led pin an output
    Loop:
    Led = (switch1 ^ switchopen) & (switch2 ^ switchopen) 'led on if both
    switches closed
    Goto loop
    End

    The expression (switch ^ switchopen) gives 0 if the switch is in the normal
    open state, and 1 if the switch is activated.
    This would also function in case of normally close switches. Tou just then
    redefine the switch constants.

    Hope this helps

    Greetings peter




    Oorspronkelijk bericht
    Van: daliti [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qwDBPXSzAQisJbaPUWkvTI4Q5cUrUeeM5TyVVuy0XjWsRh562UdQ_lQ3PQHGlB2EunXW_lUS3PPfybyQY_JNOdU]peter.christiaen@s...[/url
    Verzonden: zaterdag 21 juli 2001 23:16
    Aan: basicstamps@yahoogroups.com
    Onderwerp: [noparse][[/noparse]basicstamps] INEX-1000. Real newbee question

    Just got a few days ago a INEX-100 from my father.
    Trying to figure out the schematics of the Scott Edwards Book "Prog.
    & custom. the BS comp.".
    I just wonna make an easy AND instruction with two switches which
    will light a LED in the AND configuration. But, the light is on when
    the button switches are open and when pressing 1 of the 2 buttons,
    the lights goes out. I had to change the AND to OR and then the
    lights goes out when pressing the two buttons together. It is not
    possible to change the ground of the LED on the INEX-100 board (which
    is different then the drawing in the book, page 79).
    I think it is right to state that when an output goes high it "sends"
    a 5 V signal out and when it is low it sends a "grounded" signal (-).
    Is there a command that can changes (invert) a logic 1 (input)to a 0?
    Or is there another mutch easier solution. I tried almost 3 hours to
    change the way of working.
    Thanks.
    Tim.



    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.