Skip to content

Commit cce3d03

Browse files
committed
2 parents 869237f + ef2dbad commit cce3d03

File tree

12 files changed

+377
-2786
lines changed

12 files changed

+377
-2786
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ env:
1818
- PLATFORMIO_CI_SRC=examples/SodaqAutonomo-basic PLATFORMIO_CI_EXTRA_ARGS="--board=sodaq_autonomo"
1919
- PLATFORMIO_CI_SRC=examples/SodaqOne-TTN-Mapper-ascii PLATFORMIO_CI_EXTRA_ARGS="--board=sodaq_one"
2020
- PLATFORMIO_CI_SRC=examples/SodaqOne-TTN-Mapper-binary PLATFORMIO_CI_EXTRA_ARGS="--board=sodaq_one"
21-
- PLATFORMIO_CI_SRC=examples/SodaqOneAccelerometer PLATFORMIO_CI_EXTRA_ARGS="--board=sodaq_one"
22-
- PLATFORMIO_CI_SRC=examples/SodaqOneSimpleBicycleTracker PLATFORMIO_CI_EXTRA_ARGS="--board=sodaq_one"
2321
- PLATFORMIO_CI_SRC=examples/TheThingsUno-basic PLATFORMIO_CI_EXTRA_ARGS="--board=leonardo"
2422
- PLATFORMIO_CI_SRC=examples/TheThingsUno-GPSshield-TTN-Mapper-binary PLATFORMIO_CI_EXTRA_ARGS="--board=leonardo"
2523

examples/SodaqOne-TTN-Mapper-binary/SodaqOne-TTN-Mapper-binary.ino

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <rn2xx3.h>
3030

3131
//create an instance of the rn2xx3 library,
32-
//giving the software serial as port to use
32+
//giving Serial1 as stream to use for communication with the radio
3333
rn2xx3 myLora(Serial1);
3434

3535
String toLog;
@@ -47,8 +47,7 @@ void setup()
4747
Serial1.begin(57600);
4848

4949
// make sure usb serial connection is available,
50-
// or after 10s go on anyway for 'headless' use of the
51-
// node.
50+
// or after 10s go on anyway for 'headless' use of the node.
5251
while ((!SerialUSB) && (millis() < 10000));
5352

5453
SerialUSB.println("SODAQ LoRaONE TTN Mapper starting");
@@ -64,6 +63,11 @@ void setup()
6463
// initialize GPS
6564
sodaq_gps.init(GPS_ENABLE);
6665

66+
// Set the datarate/spreading factor at which we communicate.
67+
// DR5 is the fastest and best to use. DR0 is the slowest.
68+
myLora.setDR(dr);
69+
70+
// LED pins as outputs. HIGH=Off, LOW=On
6771
pinMode(LED_BLUE, OUTPUT);
6872
digitalWrite(LED_BLUE, HIGH);
6973
pinMode(LED_RED, OUTPUT);
@@ -124,6 +128,7 @@ void loop()
124128
sodaq_gps.scan(true);
125129
digitalWrite(LED_GREEN, HIGH);
126130

131+
// if the latitude is 0, we likely do not have a GPS fix yet, so wait longer
127132
while(sodaq_gps.getLat()==0.0)
128133
{
129134
SerialUSB.println("Latitude still 0.0, doing another scan");
@@ -178,7 +183,8 @@ void loop()
178183
digitalWrite(LED_BLUE, HIGH);
179184

180185
// Cycle between datarate 0 and 5
181-
dr = (dr + 1) % 6;
182-
myLora.setDR(dr);
186+
//dr = (dr + 1) % 6;
187+
//myLora.setDR(dr);
188+
183189
SerialUSB.println("TX done");
184190
}

0 commit comments

Comments
 (0)