DFRobot TEL0051 Manual page 34

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

Advertisement

402
/ * * * * * * * * * * * * * * * * * * * * * e n d o f g p s _ g s m _ s i m 9 0 8 . h * * * * * * * * * * * * * * * * * * * * * * * /
sample code with gps_gsm_sim908.h
?
1
/ * * * * * * * * * * * * * * * * * * * * * s t a r t o f s a m p l e c o d e * * * * * * * * * * * * * * * * * * * * * * * * * /
2
3
/ *
4
* c r e a t e d :
5
* b y :
l i s p e r ( l e y a p i n @ g m a i l . c o m )
6
* V e r s i o n :
7
* t e s t g p s g s m o n L e o n a r d o & X B E E R 3
8
*
9
* /
10
11
/ / # i f n d e f D E B U G
12
/ / # d e f i n e D E B U G
13
/ / # e n d i f
14
15
# i n c l u d e " g p s _ g s m _ s i m 9 0 8 . h "
16
17
/ /
18
v o i d s e t u p ( ) {
19
g p s _ i n i t ( ) ;
20
21
# i f d e f D E B U G
22
S e r i a l . b e g i n ( 9 6 0 0 ) ;
23
w h i l e ( ! S e r i a l ) ;
24
# e n d i f
25
26
S e r i a l 1 . b e g i n ( 9 6 0 0 ) ;
27
w h i l e ( ! S e r i a l 1 ) ;
28
29
# i f d e f D E B U G
30
S e r i a l . p r i n t l n ( " s t a r t G P S ! " ) ;
31
# e n d i f
32
33
s t a r t _ g p s ( ) ;
34
}
35
36
/ /
37
v o i d l o o p ( ) {
38
i n t s t a t = g p s _ g e t _ g g a ( ) ; / / r e a d d a t a f r o m G P S , r e t u r n 0 i s o k
39
# i f d e f D E B U G
40
S e r i a l . p r i n t l n ( " g p s _ g e t _ g g a ( ) r e t u r n s t a t : " ) ;
41
S e r i a l . p r i n t l n ( s t a t ) ; / / f o r t e s t
2 0 1 3 - 0 8 - 0 2
0 . 1
/ / i n i t G P S p i n
/ / s e r i a l 0 c o n n e c t c o m p u t e r
/ / s e r i a l 1 c o n n e c t G P S
/ / o p e n G P S

Advertisement

Table of Contents
loading

Table of Contents