Skip to content

Commit 87a1b96

Browse files
committed
Correct last address in examples
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
1 parent 5da2c2b commit 87a1b96

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
lines changed

ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
3232

3333
- **Breaking** Changed the `parseInt()`, `parseFloat()`, and `peekNextDigit()` functions so that they are better customized for reading from a data response request.
3434
- Any LookupMode or ignore inputs will be ignored.
35-
- **Potentially Breaking** Parity checking can no longer be turned off. Characters that fail parity checks will no be returned from the buffer.
35+
- **Potentially Breaking** Parity checking can no longer be turned off. Characters that fail parity checks will not be returned from the buffer.
3636
- Change fudge for 48MHz boards using millis() from 50 to 95 based on comments in [#145](https://github.com/EnviroDIY/Arduino-SDI-12/issues/145)
3737
- Reset bit timer when entering listening state.
3838
- Verify that at least one bit time has passed before processing a pin change interrupt, where possible.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The pre-scaler values needed for the SDI-12 functionality are set in the begin()
8080
## Compatibility Considerations<!-- {#mainpage_compatibility} -->
8181

8282
This library has been tested with an Arduino Uno (AtMega328p), EnviroDIY Mayfly (AtMega1284p), Adafruit Feather 32u4 (AtMega32u4, identical to Arduino Leonardo), an Adafruit Feather M0 (SAMD21G18, identical to Arduino Zero), the ESP8266, and the ESP32.
83-
It should also work on an Arduino Mega (AtMega2560), Gemma/AtTiny board, and most other AVR processors running on the Arduino framework.
83+
It should also work on an Arduino Mega (AtMega2560), Gemma/AtTiny board, and most other AVR processors running on the Arduino framework.
8484

8585
The Arduino Due, Arduino 101, and Teensy boards are not supported at this time.
8686
If you are interested in adding support for those boards, please send pull requests.

examples/c_check_all_addresses/c_check_all_addresses.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ uint32_t wake_delay = 0; /*!< Extra time needed for the sensor to wake (0-100m
3434
int8_t firstPin = 3; /*! change to lowest pin number to search on your board */
3535
int8_t lastPin = 7; /*! change to highest pin number to search on your board */
3636
int8_t firstAddress = 0; /* The first address in the address space to check (0='0') */
37-
int8_t lastAddress = 9; /* The last address in the address space to check (62='z') */
37+
int8_t lastAddress = 61; /* The last address in the address space to check (61='z') */
3838

3939
/**
4040
* @brief converts allowable address characters ('0'-'9', 'a'-'z', 'A'-'Z') to a
@@ -128,8 +128,8 @@ void scanAddressSpace(SDI12& sdi) {
128128
char addr = decToChar(i);
129129
Serial.print("i=");
130130
Serial.print(i);
131-
Serial.print("addr=");
132-
Serial.print(addr);
131+
Serial.print(" addr=");
132+
Serial.println(addr);
133133
if (checkActive(sdi, addr)) { printInfo(sdi, addr); };
134134
}
135135
}

examples/d_simple_logger/d_simple_logger.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int8_t dataPin = SDI12_DATA_PIN; /*!< The pin of the SDI-12 data bus */
3838
int8_t powerPin = SDI12_POWER_PIN; /*!< The sensor power pin (or -1) */
3939
uint32_t wake_delay = 0; /*!< Extra time needed for the sensor to wake (0-100ms) */
4040
int8_t firstAddress = 0; /* The first address in the address space to check (0='0') */
41-
int8_t lastAddress = 62; /* The last address in the address space to check (62='z') */
41+
int8_t lastAddress = 61; /* The last address in the address space to check (61='z') */
4242
bool printIO = false;
4343

4444
/** Define the SDI-12 bus */

examples/e_continuous_measurement/e_continuous_measurement.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int8_t dataPin = SDI12_DATA_PIN; /*!< The pin of the SDI-12 data bus */
2828
int8_t powerPin = SDI12_POWER_PIN; /*!< The sensor power pin (or -1) */
2929
uint32_t wake_delay = 0; /*!< Extra time needed for the sensor to wake (0-100ms) */
3030
int8_t firstAddress = 0; /* The first address in the address space to check (0='0') */
31-
int8_t lastAddress = 62; /* The last address in the address space to check (62='z') */
31+
int8_t lastAddress = 61; /* The last address in the address space to check (61='z') */
3232
bool printIO = false;
3333

3434
/** Define the SDI-12 bus */

examples/j_external_pcint_library/j_external_pcint_library.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int8_t dataPin = SDI12_DATA_PIN; /*!< The pin of the SDI-12 data bus */
3131
int8_t powerPin = SDI12_POWER_PIN; /*!< The sensor power pin (or -1) */
3232
uint32_t wake_delay = 0; /*!< Extra time needed for the sensor to wake (0-100ms) */
3333
int8_t firstAddress = 0; /* The first address in the address space to check (0='0') */
34-
int8_t lastAddress = 62; /* The last address in the address space to check (62='z') */
34+
int8_t lastAddress = 61; /* The last address in the address space to check (61='z') */
3535
bool printIO = false;
3636

3737
/** Define the SDI-12 bus */

examples/k_concurrent_logger/k_concurrent_logger.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ int8_t dataPin = SDI12_DATA_PIN; /*!< The pin of the SDI-12 data bus */
2828
int8_t powerPin = SDI12_POWER_PIN; /*!< The sensor power pin (or -1) */
2929
uint32_t wake_delay = 0; /*!< Extra time needed for the sensor to wake (0-100ms) */
3030
int8_t firstAddress = 0; /* The first address in the address space to check (0='0') */
31-
int8_t lastAddress = 62; /* The last address in the address space to check (62='z') */
31+
int8_t lastAddress = 61; /* The last address in the address space to check (61='z') */
3232
bool printIO = false;
3333

3434
/** Define the SDI-12 bus */

extras/TestCommands/TestCommands.ino

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ uint32_t wake_delay = 10; /*!< Extra time needed for the sensor to wake (0-1
2626
const int8_t firstAddress =
2727
0; /* The first address in the address space to check (0='0') */
2828
const int8_t lastAddress =
29-
62; /* The last address in the address space to check (62='z') */
29+
61; /* The last address in the address space to check (61='z') */
3030
const int8_t commandsToTest =
3131
1; /*!< The number of measurement commands to test, between 1 and 11. */
3232

@@ -363,19 +363,21 @@ getResultsResult getResults(char addr, int resultsExpected, bool verify_crc = fa
363363
// NOTE: A mis-read like this should also cause the CRC to be wrong, but still
364364
// check here in case we're not using a CRC.
365365
} else { //(c != '-' && c != '+' && (c < '0' || c > '9') && c != '.')
366-
Serial.println("Invalid data response character!");
366+
Serial.print("Invalid data response character: ");
367+
Serial.write(c);
368+
Serial.println();
367369
bad_read = true;
368370
}
369371
// if we get a decimal, mark it so we can verify we don't get repeated decimals
370372
if (c == '.') { got_decimal = true; }
371373
}
372374

373-
if (!gotResults) {
374-
if (printIO) {
375-
Serial.println((" No results received, will not continue requests!"));
376-
}
377-
break;
378-
} // don't do another loop if we got nothing
375+
// if (!gotResults) {
376+
// if (printIO) {
377+
// Serial.println((" No results received, will not continue requests!"));
378+
// }
379+
// break;
380+
// } // don't do another loop if we got nothing
379381

380382
if (gotResults && !bad_read) {
381383
resultsReceived = resultsReceived + cmd_results;
@@ -640,7 +642,7 @@ bool checkActive(char addr, int8_t numPings = 3, bool printIO = true) {
640642
Serial.println(")");
641643
if (returnedAddress == String(addr)) {
642644
if (printIO) {
643-
Serial.println("Got response from '");
645+
Serial.print("Got response from '");
644646
Serial.print(String(returnedAddress));
645647
Serial.println("'");
646648
}
@@ -665,9 +667,13 @@ bool checkActive(char addr, int8_t numPings = 3, bool printIO = true) {
665667
void setup() {
666668
Serial.begin(serialBaud);
667669
while (!Serial && millis() < 10000L);
670+
char tbuf[3] = {'\0'};
668671

669672
Serial.print("Opening SDI-12 bus on pin ");
670-
Serial.print(String(dataPin));
673+
Serial.print(dataPin);
674+
Serial.print(" (");
675+
Serial.print(itoa(dataPin, tbuf, 10));
676+
Serial.print(")");
671677
Serial.println("...");
672678
mySDI12.begin();
673679
delay(500); // allow things to settle

0 commit comments

Comments
 (0)