Shop OBEX P1 Docs P2 Docs Learn Events
can assign an input with a logic high or low?? — Parallax Forums

can assign an input with a logic high or low??

ice-egozice-egoz Posts: 55
edited 2004-09-23 04:53 in BASIC Stamp
Hi there, I wud like to assign the input pin with logic low so as to be able to switch off the alarm.
therefore the coding is like the following:

INPUT·8 ' lets say originally the logic is 0 and then after which the logic is 1 and now i wanna make···
············' it logic 0 again, is there anyway as to be able to assign IN8=0?




▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I need all ya guidance Masters. [noparse]:)[/noparse]

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-09-23 04:53
    No, an input pin only "looks" at the outside world, and if you change an input to an output you might damage the pin, depending on the pin state and the external button state (the 220-ohm resistor in our standard input circuit [noparse][[/noparse]attached] prevents damage due to programming errors).

    If you connected a standard [noparse][[/noparse]active-low]·input circuit, you could read the pin like this:

    Check_Alarm_Enable:
    · IF (IN8 = 0) THEN
    ··· ' do not sound alarm
    · ELSE
    ··· ' allow alarm to sound
    · ENDIF
    · RETURN




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
    290 x 284 - 10K
Sign In or Register to comment.