Sinewave using PSoC3/5 | Cypress Semiconductor
Sinewave using PSoC3/5
I have used the following code to generate a sinewave for freqiency 1 kHz.. But the frequency o/p that I'm getting is 35 Hz. Can anyone suggest me where I'm goin wrong? Also how do I use sine function with GCC compiler. If not supported, what's the other alternative ?
#define PI 3.14159265
float frequency = 10000.0;
float sample_per_seconds = 50000.0;
i = 0;
var = 255*(0.5 *(sin(2*PI*frequency*i/sample_per_seconds))+0.5);