We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27cf049 commit e3a5b65Copy full SHA for e3a5b65
SSD1306Ui.cpp
@@ -10,8 +10,13 @@ void SSD1306Ui::init() {
10
}
11
12
void SSD1306Ui::setTargetFPS(byte fps){
13
+ int oldInterval = this->updateInterval;
14
this->updateInterval = ((float) 1.0 / (float) fps) * 1000;
- Serial.println(this->updateInterval);
15
+
16
+ // Calculate new ticksPerFrame
17
+ float changeRatio = oldInterval / this->updateInterval;
18
+ this->ticksPerFrame *= changeRatio;
19
+ this->ticksPerTransition *= changeRatio;
20
21
22
// -/------ Automatic controll ------\-
0 commit comments