Minor rearranging of options and added static smile
This commit is contained in:
@@ -79,6 +79,7 @@ void LEDDesign_ColorGreen(void);
|
||||
void LEDDesign_ColorRed(void);
|
||||
void LEDDesign_Crazy(void);
|
||||
void LEDDesign_Smile(void);
|
||||
void LEDDesign_Smile_Audio(void);
|
||||
void LEDDesign_SuperCrazy(void);
|
||||
uint8_t lookupLED(uint8_t column, uint8_t row);
|
||||
void setLED(uint8_t pixelNumber, uint8_t redLevel, uint8_t greenLevel, uint8_t blueLevel);
|
||||
@@ -88,14 +89,7 @@ void updateWS2812BData(void);
|
||||
|
||||
/* Private user code ---------------------------------------------------------*/
|
||||
/* USER CODE BEGIN 0 */
|
||||
int _write(int32_t file, uint8_t *ptr, int32_t len)
|
||||
{
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
ITM_SendChar(*ptr++);
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
/* USER CODE END 0 */
|
||||
|
||||
/**
|
||||
@@ -148,21 +142,24 @@ int main(void)
|
||||
LEDDesign_Smile();
|
||||
break;
|
||||
case 1:
|
||||
LEDDesign_Crazy();
|
||||
LEDDesign_Smile_Audio();
|
||||
break;
|
||||
case 2:
|
||||
LEDDesign_SuperCrazy();
|
||||
LEDDesign_Crazy();
|
||||
break;
|
||||
case 3:
|
||||
LEDDesign_ColorWhite();
|
||||
LEDDesign_SuperCrazy();
|
||||
break;
|
||||
case 4:
|
||||
LEDDesign_ColorRed();
|
||||
LEDDesign_ColorWhite();
|
||||
break;
|
||||
case 5:
|
||||
LEDDesign_ColorGreen();
|
||||
LEDDesign_ColorRed();
|
||||
break;
|
||||
case 6:
|
||||
LEDDesign_ColorGreen();
|
||||
break;
|
||||
case 7:
|
||||
LEDDesign_ColorBlue();
|
||||
break;
|
||||
default:
|
||||
@@ -711,6 +708,72 @@ void LEDDesign_Crazy(void){
|
||||
}
|
||||
}
|
||||
void LEDDesign_Smile(void){
|
||||
setLED(lookupLED(0,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,2), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,3), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(0,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(1,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(1,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(2,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(2,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(3,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(3,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(4,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(4,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(5,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(5,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,2), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(6,3), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(6,7), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,1), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,2), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,3), 0x00, 0x00, 0x7F);
|
||||
setLED(lookupLED(7,4), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,5), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,6), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(7,7), 0x00, 0x00, 0x00);
|
||||
}
|
||||
void LEDDesign_Smile_Audio(void){
|
||||
uint8_t currentSoundLevel = getSoundLevel();
|
||||
setLED(lookupLED(0,0), 0x00, 0x00, 0x00);
|
||||
setLED(lookupLED(0,1), 0x00, 0x00, 0x00);
|
||||
|
||||
@@ -226,7 +226,7 @@ void TIM6_DAC_IRQHandler(void)
|
||||
/* USER CODE END TIM6_DAC_IRQn 0 */
|
||||
HAL_TIM_IRQHandler(&htim6);
|
||||
/* USER CODE BEGIN TIM6_DAC_IRQn 1 */
|
||||
LEDMode = (LEDMode + 1) % 7;
|
||||
LEDMode = (LEDMode + 1) % 8;
|
||||
LEDDesign_PendingChange = false;
|
||||
/* USER CODE END TIM6_DAC_IRQn 1 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user