View Full Version : The gsm module code- we need a conversion from basic stamp to .spin file

07-22-2009, 02:11 AM
here is the code in basicstamp2. We have it working with boebot and basicstamp. If possible, can somebody convert this to .spin file.

' {$STAMP BS2}
sData VAR Byte
SEROUT 2,84, ["at#bnd=1",CR] ' Sets for US network
PAUSE 1000
SEROUT 2,84, ["AT+CMGF=1",CR] ' Sets the module in voice mode (AT+CMGF=1 IS TEXT MODE FCLASS)
PAUSE 1000
SEROUT 2,84, ["ats0=2",13] ' Sets to
PAUSE 1000
SEROUT 2,84, ["AT+CLIP=1",CR] ' Sets to show caller ID (if you want)
PAUSE 1000
SEROUT 2, 84, ["AT+CMGS=+12246169564",CR]
PAUSE 5000
SEROUT 2, 84, ["hello",26]
PAUSE 1000
SEROUT 2,84, ["at",CR] ' Sets for US network
PAUSE 1000
'SEROUT 2,84, ["at#bnd=1",CR] ' Sets for US network
' This code simulates trying to wait for data to come through
DO ' NOTE: This should work, otherwise we need to simiuate manually (worst case scenario..but we'l have it working
SERIN 1,84, [DEC sData] ' Also note, I used PIN 1 to receive data from the other GSM Module
PAUSE 5000

Mike Green
07-22-2009, 02:35 AM
Have you looked at the BS2 Compatibility Library in the Propeller Object Exchange?

There's a demo program included with this that gives examples of its use.

If you want someone to do your work for you, that's a consulting job and you should expect to pay for the work.

If you want help, you need to learn Spin and study the BS2 Compatibility Library, then convert your program and try it.
Ask for help when you have things you don't understand or don't behave the way you expect.

The BS2 Compatibility Library has subroutine calls that will do the PAUSE statement and the SEROUT_STR subroutine call will do what the SEROUT statements are doing. You can include the CR as part of the string or you can use the SEROUT_CR to output just a carriage return. There are other subroutines to do the SERIN of a decimal value and to do the equivalent of the DEBUG statement.

Post Edited (Mike Green) : 7/21/2009 7:45:39 PM GMT