diff --git a/examples/scanner/scanner.ino b/examples/scanner/scanner.ino index 7e2cc580..c8b80093 100644 --- a/examples/scanner/scanner.ino +++ b/examples/scanner/scanner.ino @@ -215,22 +215,22 @@ void loop(void) { void printHeader() { // Print the hundreds digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) Serial.print(i / 100); Serial.println(); // Print the tens digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) Serial.print((i % 100) / 10); Serial.println(); // Print the singles digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) Serial.print(i % 10); Serial.println(); // Print the header's divider - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) Serial.print(F("~")); Serial.println(); } \ No newline at end of file diff --git a/examples_linux/scanner.cpp b/examples_linux/scanner.cpp index bed003f4..9f5cea15 100644 --- a/examples_linux/scanner.cpp +++ b/examples_linux/scanner.cpp @@ -94,7 +94,7 @@ int main(int argc, char** argv) // print a line that should not be wrapped cout << "\n!!! This example requires a width of at least 126 characters. " - << "If this text uses multiple lines, then the output will look bad.\n" + << "If this text uses multiple lines, then the output will look bad." << endl; // set the data rate @@ -179,22 +179,22 @@ int main(int argc, char** argv) void printHeader() { // print the hundreds digits - for (int i = 0; i < num_channels; ++i) - cout << (i / 100); + for (uint8_t int i = 0; i < num_channels; ++i) + cout << static_cast(i / 100); cout << endl; // print the tens digits - for (int i = 0; i < num_channels; ++i) - cout << ((i % 100) / 10); + for (uint8_t i = 0; i < num_channels; ++i) + cout << static_cast((i % 100) / 10); cout << endl; // print the singles digits - for (int i = 0; i < num_channels; ++i) - cout << (i % 10); + for (uint8_t i = 0; i < num_channels; ++i) + cout << static_cast(i % 10); cout << endl; // print the header's divider - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) cout << '~'; cout << endl; } diff --git a/examples_pico/scanner.cpp b/examples_pico/scanner.cpp index 5b723f5b..5d43d4d9 100644 --- a/examples_pico/scanner.cpp +++ b/examples_pico/scanner.cpp @@ -183,22 +183,22 @@ void scanChannel(uint8_t channel) void printHeader() { // print the hundreds digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) printf("%d", (i / 100)); printf("\n"); // print the tens digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) printf("%d", ((i % 100) / 10)); printf("\n"); // print the singles digits - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) printf("%d", (i % 10)); printf("\n"); // print the header's divider - for (int i = 0; i < num_channels; ++i) + for (uint8_t i = 0; i < num_channels; ++i) printf("~"); printf("\n"); }