conect GE864
KARIM102
Posts: 75
dear all,
how do i connect GE864 with basic stamp???? and how do i reset the GE864???
best regrads
how do i connect GE864 with basic stamp???? and how do i reset the GE864???
best regrads
Comments
' {$STAMP BS2}
' {$PBASIC 2.5}
A VAR Word
'
[Initializations]
HELP:
LOW 3
LOW 4
LOW 2
LOW 1
'=======================================================================================================
'
main routine
'=======================================================================================================
frist:
PAUSE 500
SEROUT 14 ,84, ["AT+CMGD=1,4",13,10] ' Delect All messages
SERIN 15, 84 , [WAIT("OK")]
MAIN:
PAUSE 500
SEROUT 14 , 84, ["AT+CMGF=1", 13,10] ' Text mode
SERIN 15 , 84,3000,MAIN, [WAIT("OK")]
SECOND:
PAUSE 500
SEROUT 14,84, ["AT+CNMI=1,2,0,0,0",13,10] ' Read all messages
SERIN 15 , 84,3000,SECOND,[WAIT("OK") ]
THRID:
DO
SERIN 15 , 84, [WAIT(">"),A] ' Wait to recived SMS
IF A = "A" THEN
' order to be make
HIGH 0
PAUSE 1000
SMS_Prep:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR]
SERIN 15, 84, 3000, SMS_Prep, [WAIT("OK")] ' Text mode
SMS:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS, [WAIT(">")]
SMS2:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 1 is on!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS2, [WAIT("OK")]
GOTO THRID
ELSEIF A = "a" THEN
' order to be make
LOW 0
PAUSE 1000
SMS_Prep1:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep1, [WAIT("OK")]
SMS1:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS1, [WAIT(">")]
SMS8:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 1 is off!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS8, [WAIT("OK")]
GOTO THRID
ELSEIF A = "B" THEN ' order to be make
HIGH 1
PAUSE 1000
SMS_Prep2:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep2, [WAIT("OK")]
SMS9:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS9, [WAIT(">")]
SMS3:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 2 is on!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS3, [WAIT("OK")]
GOTO THRID
ELSEIF A = "b" THEN ' order to be make
LOW 1
PAUSE 1000
SMS_Prep3:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep3, [WAIT("OK")]
SMS10:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS10, [WAIT(">")]
SMS4:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 2 is off!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS4, [WAIT("OK")]
GOTO THRID
ELSEIF A = "D" THEN
' order to be make
HIGH 2
PAUSE 1000
SMS_Prep4:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep4, [WAIT("OK")]
SMS11:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS11, [WAIT(">")]
SMS5:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 3 is on!!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS5, [WAIT("OK")]
GOTO THRID
ELSEIF A = "d" THEN ' order to be make
LOW 2
PAUSE 1000
SMS_Prep5:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep5, [WAIT("OK")]
SMS12:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS12, [WAIT(">")]
SMS6:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 3 is off!!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS6, [WAIT("OK")]
GOTO THRID
ELSEIF A = "C" THEN
' order to be make
HIGH 3
PAUSE 1000
SMS_Prep6:
PAUSE 500
SEROUT 14, 84, ["AT+CMGF=1", CR] ' Text mode
SERIN 15, 84, 3000, SMS_Prep6, [WAIT("OK")]
SMS13:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS13, [WAIT(">")]
SMS7:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 4 is on!!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS7, [WAIT("OK")]
GOTO THRID
ELSEIF A = "c" THEN ' order to be make
LOW 3
PAUSE 1000
SMS_Prep7:
PAUSE 500 ' Text mode
SEROUT 14, 84, ["AT+CMGF=1", CR]
SERIN 15, 84, 3000, SMS_Prep7, [WAIT("OK")]
SMS15:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS15, [WAIT(">")]
SMS16:
PAUSE 500
SEROUT 14, 84, ["The Light's Number 4 is off!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS16, [WAIT("OK")]
GOTO THRID
ELSEIF A = "X" THEN
LOW 0
LOW 1
LOW 2
LOW 3
PAUSE 1000
SMS_Prep8:
PAUSE 500 ' Text mode
SEROUT 14, 84, ["AT+CMGF=1", CR]
SERIN 15, 84, 3000, SMS_Prep8, [WAIT("OK")]
SMS18:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS18, [WAIT(">")]
SMS17:
PAUSE 500
SEROUT 14, 84, ["ALL lights are off!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS17, [WAIT("OK")]
GOTO THRID
ELSEIF A = "x" THEN
HIGH 0
HIGH 1
HIGH 2
HIGH 3
PAUSE 1000
SMS_Prep9:
PAUSE 500 ' Text mode
SEROUT 14, 84, ["AT+CMGF=1", CR]
SERIN 15, 84, 3000, SMS_Prep9, [WAIT("OK")]
SMS19:
PAUSE 500
SEROUT 14,84, ["AT+CMGS=", $22, "33008808", $22, CR] ' Send to this phone number
SERIN 15, 84, 3000, SMS19, [WAIT(">")]
SMS20:
PAUSE 500
SEROUT 14, 84, ["ALL lights are on!", $1A] ' Data to be send
SERIN 15, 84, 5000, SMS20, [WAIT("OK")]
GOTO THRID
ENDIF
LOOP