DFRobot TEL0051 Manual page 25

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

Advertisement

This code introduces some testing features and useful code. It's mainly coded for Leonardo devices using the
second serial port to handle GSM/GPS communications while USB serial port is left for debugging purposes. Data
from GPS is parsed and stored on variables to be used freely on your code.
?
1
/ * * * * * * * * * * * * * * * * * * * * * s t a r t o f g p s _ g s m _ s i m 9 0 8 . h * * * * * * * * * * * * * * * * * * * * * * * /
2
3
/ *
4
* b y 2 0 1 3 - 0 8 - 0 2
5
* t e s t o n L e o n a r d o
6
* S e r i a l 1 t o G P S
7
*
8
* /
9
10
/ / d e b u g
11
/ / # d e f i n e D E B U G
12
13
# i n c l u d e < A r d u i n o . h >
14
15
16
# d e f i n e g p s _ e n a b l e ( )
17
# d e f i n e g p s _ d i s a b l e ( )
18
19
# d e f i n e g s m _ e n a b l e ( )
20
# d e f i n e g s m _ d i s a b l e ( )
21
22
# d e f i n e G P S _ B U F _ S I Z E 5 0 0
23
# d e f i n e G G A _ N U M 1 5
24
# d e f i n e R M C _ N U M 1 4
25
26
/ /
27
c h a r * g g a _ t a b l e [ G G A _ N U M ] = {
28
" M e s s a g e I D " ,
29
" U T C T i m e " ,
30
" L a t i t u d e " ,
31
" N / S I n d i c a t o r " ,
32
" L o n g i t u d e " ,
33
" E / W I n d i c a t o r " ,
34
" P o s i t i o n F i x I n d i c a t o r " ,
35
" S a t e l l i t e s U s e d " ,
36
" H D O P " ,
37
" M S L A l t i t u d e " ,
38
" U n i t s ( M ) " ,
39
" G e o i d S e p a r a t i o n " ,
40
" U n i t s " ,
41
" D i f f . R e f . S t a t i o n I D " ,
d i g i t a l W r i t e ( 4 , L O W )
d i g i t a l W r i t e ( 4 , H I G H )
d i g i t a l W r i t e ( 3 , L O W )
d i g i t a l W r i t e ( 3 , H I G H )
/ / 0
/ / 1
/ / 2
/ / 3
/ / 4
/ / 5
/ / 6
/ / 7
/ / 8
/ / 9
/ / 1 0
/ / 1 1
/ / 1 2
/ / 1 3

Advertisement

Table of Contents
loading

Table of Contents