Compare commits

..

No commits in common. "34abbfbbf4cf7700a20154a3e1a60c1e4496ea25" and "598911870ca1adf3640fcacf79cde9efce223640" have entirely different histories.

1 changed files with 3 additions and 29 deletions

30
main.c
View File

@ -69,40 +69,14 @@ void AOUT(uint16_t ANALOG_SAMPLE)
I2C0_SEND(MCP4725_ADDRESS, ANALOG_SAMPLE_MSB, ANALOG_SAMPLE_LSB); //SEND 12 BIT DATA I2C0_SEND(MCP4725_ADDRESS, ANALOG_SAMPLE_MSB, ANALOG_SAMPLE_LSB); //SEND 12 BIT DATA
} }
int samples[100] = { // DECLARE WAVEFORM SHAPE
2252, 2436, 2594, 2722, 2819, 2886, 2925, 2942, 2942, 2933,
2922, 2916, 2921, 2940, 2977, 3031, 3101, 3185, 3276, 3371,
3463, 3547, 3619, 3675, 3714, 3735, 3739, 3729, 3709, 3682,
3652, 3622, 3594, 3570, 3547, 3525, 3499, 3466, 3420, 3356,
3271, 3161, 3025, 2863, 2678, 2473, 2255, 2031, 1808, 1596,
1401, 1229, 1085, 973, 891, 839, 812, 804, 809, 820,
829, 831, 819, 791, 746, 683, 606, 518, 424, 330,
241, 162, 98, 51, 21, 9, 12, 27, 51, 80,
111, 140, 166, 189, 211, 235, 264, 303, 357, 431,
528, 651, 800, 974, 1170, 1382, 1604, 1829, 2047, 2252 };
void WAVEFORM(void) // DEFINE ANALOG WAVEFORM TO GENERATE
{ int i; // DEFINE VARIABLE i
while (1)
{
for ( i=0; i< 100; i++) // TAKE EACH SAMPLE OUT OF 100 SAMPLES TO SEND TO PERIPHERAL
{
AOUT(samples[i]); // SEND ith SAMPLE TO PERIPHERAL
if (samples[i] > 4095) // RESET IF SAMPLE VALUE ABOVE MAXIMUM LIMIT
{ samples[i] = 0;
}
}
delay(1000); // DELAY TO CONTROL WAVEFORM FREQUENCY
}
}
int main(void) int main(void)
{ {
systick_setting(); // SYSTICK SETUP systick_setting(); // SysTick setup
while (1) while (1)
{ {
WAVEFORM(); // WAVEFORM
} }
} }