![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Programa para enviar mensaje GPS solicitando coordenadas, y mensaje PWM para parametrizar a distancia un PWM en klz25 utilizando modem GSM del celular siemens a56i y el satgem como simulador de GPS
GPS.h@0:2baec676c5bf, 2016-11-30 (annotated)
- Committer:
- jdlodonog
- Date:
- Wed Nov 30 03:02:42 2016 +0000
- Revision:
- 0:2baec676c5bf
Envi? palabra por mensaje de text0 GSM y retorna coordenadas de google maps, envi? de PWM y parametros de salida PWM en kl25z
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jdlodonog | 0:2baec676c5bf | 1 | /* mbed EM-406 GPS Module Library |
jdlodonog | 0:2baec676c5bf | 2 | * Copyright (c) 2008-2010, sford |
jdlodonog | 0:2baec676c5bf | 3 | * |
jdlodonog | 0:2baec676c5bf | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
jdlodonog | 0:2baec676c5bf | 5 | * of this software and associated documentation files (the "Software"), to deal |
jdlodonog | 0:2baec676c5bf | 6 | * in the Software without restriction, including without limitation the rights |
jdlodonog | 0:2baec676c5bf | 7 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
jdlodonog | 0:2baec676c5bf | 8 | * copies of the Software, and to permit persons to whom the Software is |
jdlodonog | 0:2baec676c5bf | 9 | * furnished to do so, subject to the following conditions: |
jdlodonog | 0:2baec676c5bf | 10 | * |
jdlodonog | 0:2baec676c5bf | 11 | * The above copyright notice and this permission notice shall be included in |
jdlodonog | 0:2baec676c5bf | 12 | * all copies or substantial portions of the Software. |
jdlodonog | 0:2baec676c5bf | 13 | * |
jdlodonog | 0:2baec676c5bf | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
jdlodonog | 0:2baec676c5bf | 15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
jdlodonog | 0:2baec676c5bf | 16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
jdlodonog | 0:2baec676c5bf | 17 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
jdlodonog | 0:2baec676c5bf | 18 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
jdlodonog | 0:2baec676c5bf | 19 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
jdlodonog | 0:2baec676c5bf | 20 | * THE SOFTWARE. |
jdlodonog | 0:2baec676c5bf | 21 | */ |
jdlodonog | 0:2baec676c5bf | 22 | |
jdlodonog | 0:2baec676c5bf | 23 | #include "mbed.h" |
jdlodonog | 0:2baec676c5bf | 24 | |
jdlodonog | 0:2baec676c5bf | 25 | #ifndef MBED_GPS_H |
jdlodonog | 0:2baec676c5bf | 26 | #define MBED_GPS_H |
jdlodonog | 0:2baec676c5bf | 27 | |
jdlodonog | 0:2baec676c5bf | 28 | /** A GPS interface for reading from a Globalsat EM-406 GPS Module */ |
jdlodonog | 0:2baec676c5bf | 29 | class GPS { |
jdlodonog | 0:2baec676c5bf | 30 | public: |
jdlodonog | 0:2baec676c5bf | 31 | |
jdlodonog | 0:2baec676c5bf | 32 | /** Create the GPS interface, connected to the specified serial port |
jdlodonog | 0:2baec676c5bf | 33 | */ |
jdlodonog | 0:2baec676c5bf | 34 | GPS(PinName tx, PinName rx); |
jdlodonog | 0:2baec676c5bf | 35 | |
jdlodonog | 0:2baec676c5bf | 36 | /** Sample the incoming GPS data, returning whether there is a lock |
jdlodonog | 0:2baec676c5bf | 37 | * |
jdlodonog | 0:2baec676c5bf | 38 | * @return 1 if there was a lock when the sample was taken (and therefore .longitude and .latitude are valid), else 0 |
jdlodonog | 0:2baec676c5bf | 39 | */ |
jdlodonog | 0:2baec676c5bf | 40 | int sample(); |
jdlodonog | 0:2baec676c5bf | 41 | |
jdlodonog | 0:2baec676c5bf | 42 | /** The longitude (call sample() to set) */ |
jdlodonog | 0:2baec676c5bf | 43 | float longitude; |
jdlodonog | 0:2baec676c5bf | 44 | |
jdlodonog | 0:2baec676c5bf | 45 | /** The latitude (call sample() to set) */ |
jdlodonog | 0:2baec676c5bf | 46 | float latitude; |
jdlodonog | 0:2baec676c5bf | 47 | |
jdlodonog | 0:2baec676c5bf | 48 | private: |
jdlodonog | 0:2baec676c5bf | 49 | float trunc(float v); |
jdlodonog | 0:2baec676c5bf | 50 | void getline(); |
jdlodonog | 0:2baec676c5bf | 51 | |
jdlodonog | 0:2baec676c5bf | 52 | Serial _gps; |
jdlodonog | 0:2baec676c5bf | 53 | char msg[256]; |
jdlodonog | 0:2baec676c5bf | 54 | |
jdlodonog | 0:2baec676c5bf | 55 | }; |
jdlodonog | 0:2baec676c5bf | 56 | |
jdlodonog | 0:2baec676c5bf | 57 | #endif |
jdlodonog | 0:2baec676c5bf | 58 |