Er.abdulrehman
Member level 2
How to generate 16 different led patterns with a single switch?
Suggest the logic...
Thanks in advance.
Suggest the logic...
Thanks in advance.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#define NUM_STATES 16
char Pattern[NUM_STATES] = {
// Enter your predefined patterns
};
void ButtonISR(void) {
static uint8 index = 0;
index++;
if(index == NUM_STATES) index = 0;
LedPortOut = Pattern[index];
}