mirror of
https://github.com/switchbrew/switch-examples.git
synced 2025-07-01 09:12:14 +02:00
added my own codes to notification-led example
This commit is contained in:
parent
6027f34bfd
commit
e3f4ceca75
@ -34,8 +34,11 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
initflag = 1;
|
initflag = 1;
|
||||||
|
printf("Press X for flashing notification-LED pattern.\n");
|
||||||
|
printf("Press Y for faster strobe-like flashing notification-LED pattern.\n");
|
||||||
printf("Press A to set a Breathing effect notification-LED pattern.\n");
|
printf("Press A to set a Breathing effect notification-LED pattern.\n");
|
||||||
printf("Press B to set a Heartbeat effect notification-LED pattern.\n");
|
printf("Press B to set a Heartbeat effect notification-LED pattern.\n");
|
||||||
|
printf("Press - to disable notification-LED only\n");
|
||||||
printf("Press + to disable notification-LED and exit.\n");
|
printf("Press + to disable notification-LED and exit.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +56,72 @@ int main(int argc, char* argv[])
|
|||||||
// Disable notification led.
|
// Disable notification led.
|
||||||
memset(&pattern, 0, sizeof(pattern));
|
memset(&pattern, 0, sizeof(pattern));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//only turn off all leds!
|
||||||
|
else if (kDown & KEY_MINUS) {
|
||||||
|
// Disable notification led.
|
||||||
|
memset(&pattern, 0, sizeof(pattern));
|
||||||
|
}
|
||||||
|
|
||||||
|
//my testing code
|
||||||
|
else if (kDown & KEY_X) {
|
||||||
|
memset(&pattern, 0, sizeof(pattern));
|
||||||
|
|
||||||
|
//Ely's code for flashing led on the home button on the joycons//
|
||||||
|
pattern.baseMiniCycleDuration = 0x1; // 12.5 ms
|
||||||
|
pattern.totalMiniCycles = 0x2; // 3 mini cycles. Last one 12.5ms.
|
||||||
|
pattern.totalFullCycles = 0x0; // Repeat forever.
|
||||||
|
pattern.startIntensity = 0xF; // 100%.
|
||||||
|
|
||||||
|
|
||||||
|
pattern.miniCycles[0].ledIntensity = 0xF; // 100%.
|
||||||
|
pattern.miniCycles[0].transitionSteps = 0xF; // 15 steps. Total 187.5ms.
|
||||||
|
pattern.miniCycles[0].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[1].ledIntensity = 0x0; // 0%.
|
||||||
|
pattern.miniCycles[1].transitionSteps = 0xF; // 15 steps. Total 187.5ms.
|
||||||
|
pattern.miniCycles[1].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
|
||||||
|
pattern.miniCycles[2].ledIntensity = 0xF; // 100%
|
||||||
|
pattern.miniCycles[2].transitionSteps = 0xF; // 15 steps. Total 187.5ms.
|
||||||
|
pattern.miniCycles[2].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[3].ledIntensity = 0x0; // 0%
|
||||||
|
pattern.miniCycles[3].transitionSteps = 0xF; // 15 steps. Total 187.5ms.
|
||||||
|
pattern.miniCycles[3].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
else if (kDown & KEY_Y) {
|
||||||
|
memset(&pattern, 0, sizeof(pattern));
|
||||||
|
|
||||||
|
//Ely's test code for very fast strobe-like flashing led on the home button on the joycons//
|
||||||
|
//it is strobe-like!!! :) - very sweet, I love this pattern! :) ELY M.
|
||||||
|
|
||||||
|
pattern.baseMiniCycleDuration = 0x1; // 12.5 ms
|
||||||
|
pattern.totalMiniCycles = 0x2; // 3 mini cycles. Last one 12.5ms.
|
||||||
|
pattern.totalFullCycles = 0x0; // Repeat forever.
|
||||||
|
pattern.startIntensity = 0xF; // 100%.
|
||||||
|
|
||||||
|
pattern.miniCycles[0].ledIntensity = 0xF; // 100%.
|
||||||
|
pattern.miniCycles[0].transitionSteps = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[0].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[1].ledIntensity = 0x0; // 0%.
|
||||||
|
pattern.miniCycles[1].transitionSteps = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[1].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
|
||||||
|
pattern.miniCycles[2].ledIntensity = 0xF; // 100%
|
||||||
|
pattern.miniCycles[2].transitionSteps = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[2].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[3].ledIntensity = 0x0; // 0%
|
||||||
|
pattern.miniCycles[3].transitionSteps = 0x0; // Forced 12.5ms.
|
||||||
|
pattern.miniCycles[3].finalStepDuration = 0x0; // Forced 12.5ms.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
else if (kDown & KEY_A) {
|
else if (kDown & KEY_A) {
|
||||||
memset(&pattern, 0, sizeof(pattern));
|
memset(&pattern, 0, sizeof(pattern));
|
||||||
|
|
||||||
@ -102,7 +171,7 @@ int main(int argc, char* argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kDown & (KEY_A | KEY_B | KEY_PLUS)) {
|
if (kDown & (KEY_X | KEY_Y | KEY_A | KEY_B | KEY_MINUS | KEY_PLUS)) {
|
||||||
total_entries = 0;
|
total_entries = 0;
|
||||||
memset(UniquePadIds, 0, sizeof(UniquePadIds));
|
memset(UniquePadIds, 0, sizeof(UniquePadIds));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user