Sevseg kamu sama dengan aku namun saya susah mengatur desimal nya

Continuing the discussion from The easiest way to control a multiplexed 7-segment display unit!:

sevseg kamu sama dengan aku namun saya susah mengatur dp atau desimal nya bahkan program saat ini entah kenapa desimal nya tampil semua ,ada yang bisa membantu saya

#include <SevSeg.h>
SevSeg sevseg;

// ================= PIN =================
#define STEP_PIN A5
#define DIR_PIN 0
#define BUZZER A4

#define BTN_DEC_SPEED 2
#define BTN_INC_SPEED A2
#define BTN_FWD A3
#define BTN_REV A7
#define BTN_STOP A6
#define BTN_MAX_SPEED 3

// ================= SPEED DATA =================
float speedOptions[] = {
0.01, 0.02, 0.05,
0.1, 0.2, 0.5,
1.0, 2.0, 5.0,
10.0, 18.0
};

const int pulseDelays[] = {
1200, 1000, 800, 600, 400,
200, 100, 50, 20, 15, 10
};

int currentSpeedIndex = 6;
int pulseDelay = pulseDelays[currentSpeedIndex];

// ================= MOTOR =================
bool motorRun = false;
bool lastStepState = false;
unsigned long lastStepTime = 0;

// ================= BUTTON =================
bool lastBtnInc = LOW, lastBtnDec = LOW, lastBtnFwd = LOW;
bool lastBtnRev = LOW, lastBtnStop = LOW, lastBtnMax = LOW;
unsigned long lastDebounceTime = 0;
const unsigned long debounceDelay = 50;

// ================= BUZZER =================
bool beepActive = false;
unsigned long beepStart = 0;

// ===================================================
void showSpeed(float v) {
sevseg.blank();
if (v < 0.1) {
sevseg.setNumber((int)(v * 100 + 0.5), 2); // 0.01
}
else if (v < 1.0) {
sevseg.setNumber((int)(v * 10 + 0.5), 1); // 0.1
}
else if (v < 10.0) {
sevseg.setNumber((int)(v * 10 + 0.5), 1); // 1.0
}
else {
sevseg.setNumber((int)(v * 10 + 0.5), 1); // 10.0
}
}

// ===================================================
void startBeep() {
beepActive = true;
beepStart = millis();
digitalWrite(BUZZER, HIGH);
}

void updateBeep() {
if (beepActive && millis() - beepStart > 200) {
digitalWrite(BUZZER, LOW);
beepActive = false;
}
}

// ===================================================
void checkButtons() {
if (millis() - lastDebounceTime < debounceDelay) return;

bool inc = digitalRead(BTN_INC_SPEED);
bool dec = digitalRead(BTN_DEC_SPEED);
bool fwd = digitalRead(BTN_FWD);
bool maxs = digitalRead(BTN_MAX_SPEED);
bool stop = analogRead(BTN_STOP) > 500;
bool rev = analogRead(BTN_REV) > 500;

if (inc && !lastBtnInc && currentSpeedIndex < 10) {
currentSpeedIndex++;
pulseDelay = pulseDelays[currentSpeedIndex];
showSpeed(speedOptions[currentSpeedIndex]);
startBeep();
}

if (dec && !lastBtnDec && currentSpeedIndex > 0) {
currentSpeedIndex--;
pulseDelay = pulseDelays[currentSpeedIndex];
showSpeed(speedOptions[currentSpeedIndex]);
startBeep();
}

if (maxs && !lastBtnMax) {
currentSpeedIndex = 10;
pulseDelay = pulseDelays[10];
showSpeed(speedOptions[10]);
startBeep();
}

if (fwd && !lastBtnFwd) {
digitalWrite(DIR_PIN, LOW);
motorRun = true;
startBeep();
}

if (rev && !lastBtnRev) {
digitalWrite(DIR_PIN, HIGH);
motorRun = true;
startBeep();
}

if (stop && !lastBtnStop) {
motorRun = false;
startBeep();
}

lastBtnInc = inc;
lastBtnDec = dec;
lastBtnFwd = fwd;
lastBtnRev = rev;
lastBtnStop = stop;
lastBtnMax = maxs;
lastDebounceTime = millis();
}

// ===================================================
void stepMotor() {
if (!motorRun) return;

if (micros() - lastStepTime >= pulseDelay) {
lastStepTime = micros();
lastStepState = !lastStepState;
digitalWrite(STEP_PIN, lastStepState);
}
}

// ===================================================
void setup() {
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
pinMode(BUZZER, OUTPUT);

pinMode(BTN_DEC_SPEED, INPUT);
pinMode(BTN_INC_SPEED, INPUT);
pinMode(BTN_FWD, INPUT);
pinMode(BTN_REV, INPUT);
pinMode(BTN_STOP, INPUT);
pinMode(BTN_MAX_SPEED, INPUT);

byte numDigits = 4;
byte digitPins[] = {9, 10, 11, 12}; // lewat NPN
byte segmentPins[] = {A0, A1, 4, 5, 6, 7, 8, 13}; // a b c d e f g dp

sevseg.begin(
COMMON_ANODE,
numDigits,
digitPins,
segmentPins,
true, // resistor di segment
false,
false,
false // DP AKTIF
);

sevseg.setBrightness(90);

}

// ===================================================
void loop() {
checkButtons();
stepMotor();
sevseg.refreshDisplay(); // WAJIB
updateBeep();
}

atau setidak nya beritahu bagaimana agar desimal nya bisa di tata ulang letak nya

I have split your post out to its own topic @crypimad.

In the future, please only reply on an existing forum topic in the case where you have something to add of direct relevance to that conversation. It is not appropriate to tack an only tangentially related support request onto an existing topic. This is referred to as "hijacking". You will also be more likely to get effective assistance when you have a dedicated topic for your request.

This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

Please use the English language in the English sections of the forum. Use a translation service like google translate (https://translate.google.com/?sl=auto&tl=en&op=translate)

Please edit your opening post, select all code and click the <CODE> button; next save your post. It makes the code easier to read, easier to copy and the forum software will display it correctly. See https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum/679966#posting-code

What board are you using that lets you use DIO0 (zero) as a button pin? Pin 13 (your DP pin) is on a circuit with the "L" LED of the Uno/Nano board and might be giving you that "always on" problem.

Papan apa yang Anda gunakan yang memungkinkan Anda menggunakan DIO0 (nol) sebagai pin tombol? Pin 13 (pin DP Anda) berada di sirkuit dengan LED "L" dari papan Uno/Nano dan mungkin memberi Anda masalah "selalu aktif".

Please, format your code, and use <CODE> button and paste your code in a code block.
Silakan, format kode Anda, dan gunakan tombol <CODE> dan tempel kode Anda di blok kode.