Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Signalas (unsigned int Samples, unsigned int Ampl){
- for(i=0; i<Samples/4; i++)
- Table[i]=i*12.125;
- for(i=Samples/4; i<Samples/2; i++)
- Table[i]=Ampl;
- for(i=Samples/2; i<(Samples*3/4); i++)
- Table[i]=-(i-(Samples*3/4))*12.125;
- for(i=(Samples*3/4); i<Samples; i++)
- Table[i]=0;
- while(1)
- {
- for(i=0;i<Samples;i++)
- {
- HAL_DAC_SetValue(&hdac, DAC_CHANNEL_1, DAC_ALIGN_12B_R, Table[i]);
- HAL_DAC_Start(&hdac, DAC_CHANNEL_1); // pass DACValue to the DAC
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement