Skip to content

Commit a215c16

Browse files
committed
Change DJ crossfade to unsigned
This was the only control in the library that had its output modified from what the controller reported. Changing this back to unsigned so that it's unmodified and matches all of the other unsigned data types.
1 parent bff0f6a commit a215c16

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

examples/DJ/DJ_Demo/DJ_Demo.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,15 @@ void loop() {
108108
Serial.print("The effect dial is at ");
109109
Serial.println(fx);
110110

111-
// Read the crossfade slider (-8-7, negative to the left)
111+
// Read the crossfade slider (0-15, left to right)
112112
int cross = dj.crossfadeSlider();
113113

114114
Serial.print("The crossfade slider is ");
115115

116-
if (cross <= -2) {
116+
if (cross <= 6) {
117117
Serial.println("left");
118118
}
119-
else if (cross >= 1) {
119+
else if (cross >= 9) {
120120
Serial.println("right");
121121
}
122122
else {

src/controllers/DJTurntable.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ uint8_t DJTurntableController_Shared::effectDial() const {
6969
return getControlData(Maps::EffectDial);
7070
}
7171

72-
int8_t DJTurntableController_Shared::crossfadeSlider() const {
73-
return getControlData(Maps::CrossfadeSlider) - 8; // Shifted to signed int
72+
uint8_t DJTurntableController_Shared::crossfadeSlider() const {
73+
return getControlData(Maps::CrossfadeSlider);
7474
}
7575

7676
boolean DJTurntableController_Shared::buttonEuphoria() const {
@@ -154,7 +154,7 @@ void DJTurntableController_Shared::printDebug(Print& output) {
154154
char euphoriaPrint = buttonEuphoria() ? 'E' : fillCharacter;
155155

156156
sprintf(buffer,
157-
" Joy:(%2u, %2u) | %c | %c%c | FX: %2u | Fade: %2d",
157+
" Joy:(%2u, %2u) | %c | %c%c | FX: %2u | Fade: %2u",
158158
joyX(), joyY(),
159159
euphoriaPrint,
160160
minusPrint, plusPrint,

src/controllers/DJTurntable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace NintendoExtensionCtrl {
7575
boolean buttonBlue() const;
7676

7777
uint8_t effectDial() const; // 5 bits, 0-31. One rotation per rollover.
78-
int8_t crossfadeSlider() const; // 4 bits, -8-7. Negative to the left.
78+
uint8_t crossfadeSlider() const; // 4 bits, 0-15. Left to right.
7979

8080
boolean buttonEuphoria() const;
8181

0 commit comments

Comments
 (0)