Created
March 6, 2023 06:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Function: void IO_LEDHello(void) | |
* Description: Barrido de LEDs, test demo | |
* Precondition: None | |
* Parameters: None | |
* Return Values: None | |
* Remarks: None | |
******************************************************************************/ | |
void IO_LEDHello(void){ | |
uint8_t LED_COUNTER; | |
for(LED_COUNTER=1; LED_COUNTER<5; LED_COUNTER++){ | |
IO_LEDPrintChar(LED_COUNTER); | |
Delay_ms(250); | |
} | |
for(LED_COUNTER=4; LED_COUNTER>0; LED_COUNTER--){ | |
IO_LEDPrintChar(LED_COUNTER); | |
Delay_ms(250); | |
} | |
} | |
/******************************************************************************* | |
* Function: void MCU_LEDPrintChar(unsigned char LEDCHAR) | |
* Description: Imprime LEDCHAR en los leds de salida. | |
* Precondition: None | |
* Parameters: LEDCHAR combinación seleccionada | |
* Return Values: None | |
* Remarks: None | |
******************************************************************************/ | |
void IO_LEDPrintChar(uint8_t LEDCHAR){ | |
switch(LEDCHAR){ | |
case 0: | |
LED2_Status_SetLow(); | |
LED3_Status_SetLow(); | |
LED4_Status_SetLow(); | |
LED5_Status_SetLow(); | |
break; | |
case 1: | |
LED2_Status_SetHigh(); | |
LED3_Status_SetLow(); | |
LED4_Status_SetLow(); | |
LED5_Status_SetLow(); | |
break; | |
case 2: | |
LED2_Status_SetLow(); | |
LED3_Status_SetHigh(); | |
LED4_Status_SetLow(); | |
LED5_Status_SetLow(); | |
break; | |
case 3: | |
LED2_Status_SetLow(); | |
LED3_Status_SetLow(); | |
LED4_Status_SetHigh(); | |
LED5_Status_SetLow(); | |
break; | |
case 4: | |
LED2_Status_SetLow(); | |
LED3_Status_SetLow(); | |
LED4_Status_SetLow(); | |
LED5_Status_SetHigh(); | |
break; | |
default: | |
LED2_Status_SetLow(); | |
LED3_Status_SetLow(); | |
LED4_Status_SetLow(); | |
LED5_Status_SetLow(); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment