Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
BMSVieira authored Jan 19, 2024
1 parent bebb9d8 commit 878e1f0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,35 @@ There are specific methods you can use for each type of NMEA Sentence, because t
| sentenceType| `string`|
| speed | `float` |

◼️ Usage:
-

There are two ways of extract information, either send the NMEA sentence in the constructor or pass it as variable, for example:

<b>Constructor:</b>
```javascript
demo = new Nmea("$GPRMC,001225,A,2832.1834,N,08101.0536,W,12,25,251211,1.2,E,A*03");

// Now you can explore this NMEA sentence without having to pass it as a paremeter when using the method, for example:

demo.getInfo("speed"); // 12
demo.getInfo("heading"); // 25
demo.getInfo("magneticVariation"); // 1.2
...
```

<b>As a paremeter:</b>
```javascript
demo = new Nmea();

// Now you have the nmea.js library ready to extract information from multiple and different nmea sentences, as long as you pass it as parameter, for example:

demo.getInfo("speed", "$GPRMC,001225,A,2832.1834,N,08101.0536,W,12,25,251211,1.2,E,A*03"); // 12
demo.getInfo("heading", "$GPRMC,001225,A,2832.1834,N,08101.0536,W,12,25,251211,1.2,E,A*03"); // 25
demo.getInfo("magneticVariation", "$GPRMC,001225,A,2832.1834,N,08101.0536,W,12,25,251211,1.2,E,A*03"); // 1.2
demo.getInfo("altitudeUnits", "$GPGGA,092751.000,5321.6802,N,00630.3371,W,1,8,1.03,61.7,M,55.3,M,,*75"); // M
demo.getInfo("hdop", "$GPGGA,092751.000,5321.6802,N,00630.3371,W,1,8,1.03,61.7,M,55.3,M,,*75"); // 1.03


...
```

0 comments on commit 878e1f0

Please sign in to comment.