Shop OBEX P1 Docs P2 Docs Learn Events
code dial number and the keep transmitting tone on speaker of telephone as call — Parallax Forums

code dial number and the keep transmitting tone on speaker of telephone as call

alexeenalexeen Posts: 6
edited 2008-12-17 03:41 in BASIC Stamp
please help me debug this code . problem is that it keep dialing tone even when call is answered and you can hear it in headset of telephone?? please help


' {$STAMP BS2e}
' {$PBASIC 2.5}
DO

DEBUG ? IN5 ' checks input

IF (IN0 = 1) AND (IN1 = 0) AND (IN2 = 0) AND (IN3 = 0) THEN ' if segment is 1 then dail num on location
HIGH 5 ' activates relay
DTMFOUT 15, [noparse][[/noparse]7,8,1,2,1,9,7,5,8,9] ' dial #
PAUSE 4000

ELSEIF (IN0 = 0) AND (IN1 = 1) AND (IN2 = 0) AND (IN3 = 0) THEN ' if segment is 2 then dail num on location
HIGH 5 ' activates relay
DTMFOUT 15, [noparse][[/noparse]6,1,7,9,5,3,2,8,9,9] ' dial #
PAUSE 4000

ELSEIF (IN0 = 1) AND (IN1 = 1) AND (IN2 = 0) AND (IN3 = 0) THEN ' if segment is 3 then dail num on location
HIGH 5 ' activates relay
DTMFOUT 15, [noparse][[/noparse]7,8,1,2,1,9,7,5,8,9] ' dial #
PAUSE 4000

ELSEIF (IN0 = 0) AND (IN1 = 0) AND (IN2 = 1) AND (IN3 = 0) THEN ' if segment is 4 then dail num on location
HIGH 5 ' activates relay
DTMFOUT 15, [noparse][[/noparse]7,8,1,2,1,9,7,5,8,9] ' dial #
PAUSE 4000

ELSEIF (IN0 = 0) AND (IN1 = 0) AND (IN2 = 0) AND (IN3 = 1) THEN
LOW 5 ' hangup

ELSE
LOW 5 'end call
PAUSE 2000

ENDIF

LOOP

Comments

  • lenswerkslenswerks Posts: 40
    edited 2008-12-17 03:41
    Appears you're staying in the loop until--

    ELSEIF (IN0 = 0) AND (IN1 = 0) AND (IN2 = 0) AND (IN3 = 1) THEN
    LOW 5 ' hangup

    After dialing, get in a·test for time to hangup only·loop.
Sign In or Register to comment.