I am trying to use discovery board DAC module to adjust my external led's brightness by giving different level out voltage.
I am sure that led is working on 3V, GPIOA.PA5 port also is working.
But when I run the following my DAC module, the led has no light at all. Any ideas?
GPIOInitDef.Pin = GPIO_PIN_4;
GPIOInitDef.Mode = GPIO_MODE_ANALOG;
GPIOInitDef.Pull = GPIO_NOPULL;
GPIOInitDef.Speed = GPIO_SPEED_FREQ_LOW;
DACHandleTypeStruct.Instance = DAC;
Ret = HAL_DAC_Init(&DACHandleTypeStruct);
DACChannelConfStruct.DAC_Trigger = DAC_TRIGGER_NONE;
DACChannelConfStruct.DAC_OutputBuffer = DAC_OUTPUTBUFFER_ENABLE;
Ret = HAL_DAC_ConfigChannel(&DACHandleTypeStruct,&DACChannelConfStruct, DAC_CHANNEL_1);
Ret = HAL_DAC_Start(&DACHandleTypeStruct, DAC_CHANNEL_1);
HAL_DAC_SetValue(&DACHandleTypeStruct, DAC_CHANNEL_1, DAC_ALIGN_12B_R, 0x0FFF);