code dial number and the keep transmitting tone on speaker of telephone as call
alexeen
Posts: 6
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
' {$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
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.