DFRobot TEL0051 Manual page 27

Gps/gprs/gsm module v3.0
Hide thumbs Also See for TEL0051:
Table of Contents

Advertisement

87
88
g s m _ e n a b l e ( ) ;
89
g p s _ d i s a b l e ( ) ;
90
91
d e l a y ( 2 0 0 0 ) ;
92
# i f d e f D E B U G
93
S e r i a l . p r i n t l n ( " w a i t i n g f o r G P S ! " ) ;
94
# e n d i f
95
96
S e r i a l 1 . p r i n t l n ( " A T " ) ;
97
# i f d e f D E B U G
98
S e r i a l . p r i n t l n ( " S e n d A T " ) ;
99
# e n d i f
100
d e l a y ( 1 0 0 0 ) ;
101
S e r i a l 1 . p r i n t l n ( " A T + C G P S P W R = 1 " ) ;
102
# i f d e f D E B U G
103
S e r i a l . p r i n t l n ( " S e n d A T + C G P S P W R = 1 " ) ;
104
# e n d i f
105
d e l a y ( 1 0 0 0 ) ;
106
S e r i a l 1 . p r i n t l n ( " A T + C G P S R S T = 1 " ) ;
107
# i f d e f D E B U G
108
S e r i a l . p r i n t l n ( " S e n d A T + C G P S R S T = 1 " ) ;
109
# e n d i f
110
d e l a y ( 1 0 0 0 ) ;
111
112
g s m _ d i s a b l e ( ) ;
113
g p s _ e n a b l e ( ) ;
114
115
d e l a y ( 2 0 0 0 ) ;
116
# i f d e f D E B U G
117
S e r i a l . p r i n t l n ( " $ G P G G A s t a t e m e n t i n f o r m a t i o n : " ) ;
118
# e n d i f
119
}
120
121
/ / r e a d d a t a t o g p s _ b u f [ ] f r o m G P S
122
s t a t i c i n t g p s _ r e a d ( ) {
123
u i n t 3 2 _ t s t a r t _ t i m e = m i l l i s ( ) ;
124
w h i l e ( ! S e r i a l 1 . a v a i l a b l e ( ) ) {
125
i f ( m i l l i s ( ) - s t a r t _ t i m e > 1 5 0 0 ) {
126
# i f d e f D E B U G
127
S e r i a l . p r i n t l n ( " r e s t a r t G P S . . . . . . " ) ;
128
# e n d i f
129
s t a r t _ g p s ( ) ;
130
}
131
}

Advertisement

Table of Contents
loading

Table of Contents