' **********************************************************************
' * Script name:   Event counter                                       *
' * Description:   The unit sned a messages when te input 1 was        *
' *                connected to ground 3 times and 5 times             *
' * Responsible:   Ramiro Sanchez                                      *
' * Date:          03/08/2011                                          *
' **********************************************************************
' --------------------------------------------------------------------
' General configuration
' --------------------------------------------------------------------
AT&F
AT+GSN
AT$PKG?
AT$MDMID?
at+cgatt=0
at+cgdcont=1,"IP","internet3.voicestream.com"
at$friend=1,1,"209.42.60.137"
at$udpapi=,1720

AT$STOATEV=3,AT$MSGSND=0,"COUNTER REACHED 3!!!"
'AT$EVENT=40,1,12,1,1
AT$EVENT=40,1,53,3,3
AT$EVENT=40,3,44,3,0

AT$STOATEV=2,AT$MSGSND=0,"COUNTER REACHED 5!!!"
AT$EVENT=50,1,51,0,0
AT$EVENT=50,3,44,2,0

AT$STOATEV=4,AT$MSGSND=0,"COUNTER REACHED 8!!!"
AT$EVENT=60,1,53,8,8
AT$EVENT=60,3,44,4,0

AT$STOATEV=1,AT$MSGSND=0,"INPUT 1"
AT$EVENT=80,0,0,0,0
AT$EVENT=80,3,44,1,0
AT$EVENT=80,3,40,80,3674318
AT$EVENT=80,3,47,0,5

at+cgatt=0
at$areg=2
at&w