From e11617a231fdbc99e92f18f7978097a6b49a2a1e Mon Sep 17 00:00:00 2001 From: Michele Zaffalon Date: Sat, 6 Sep 2025 15:49:33 +0200 Subject: [PATCH] Replace not recommended function According to the Arduino language reference, setClockDivider() should not be used in new projects --- .../S7S_Example_SPI_Basic/S7S_Example_SPI_Basic.ino | 2 +- .../S7S_Example_SPI_Settings/S7S_Example_SPI_Settings.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Basic/S7S_Example_SPI_Basic.ino b/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Basic/S7S_Example_SPI_Basic.ino index bb32dab..7b7c813 100644 --- a/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Basic/S7S_Example_SPI_Basic.ino +++ b/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Basic/S7S_Example_SPI_Basic.ino @@ -37,7 +37,7 @@ void setup() Serial.println("OpenSegment Example Code"); SPI.begin(); //Start the SPI hardware - SPI.setClockDivider(SPI_CLOCK_DIV64); //Slow down the master a bit + SPI.beginTransaction(SPISettings(250000, MSBFIRST, SPI_MODE0)); // S7S max speed is 250kHz //Send the reset command to the display - this forces the cursor to return to the beginning of the display digitalWrite(csPin, LOW); //Drive the CS pin low to select OpenSegment diff --git a/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Settings/S7S_Example_SPI_Settings.ino b/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Settings/S7S_Example_SPI_Settings.ino index 5ac5fb9..d605173 100644 --- a/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Settings/S7S_Example_SPI_Settings.ino +++ b/firmware/Serial 7-Segment Display/Arduino_Examples/S7S_Example_SPI_Settings/S7S_Example_SPI_Settings.ino @@ -37,7 +37,7 @@ void setup() Serial.println("OpenSegment Example Code"); SPI.begin(); //Start the SPI hardware - SPI.setClockDivider(SPI_CLOCK_DIV16); //Slow down the master a bit + SPI.beginTransaction(SPISettings(250000, MSBFIRST, SPI_MODE0)); // S7S max speed is 250kHz //Send the reset command to the display - this forces the cursor to return to the beginning of the display digitalWrite(csPin, LOW); //Drive the CS pin low to select OpenSegment