ICS Advent AOB8/16 Product Manual page 34

Table of Contents

Advertisement

void sinecurve()
{
int
double
if (counts == 0) return;
clrscr();
printf("Calculating sine wave points....");
rads = (double) 2 * PI / (counts - 1);
for(i = 0;i <counts;i++)
{
sine = (sin(rads * i) + 1.0) * 32767;
progstruct[i] = (unsigned) sine;
}
clrscr();
printf("Generating sine wave, press any key to stop....");
sendtoport();
}
/* end sinecurve */
Function: trianglecurve( ) - local routine
Purpose:
Input:
Calls:
Output:
void trianglecurve(void)
{
int
double
if (counts == 0) return;
clrscr();
Printf("Calculating triangle wave points....");
slope = 65535.0 / counts * 2.0;
for(i=0;i <counts/2;i++)
{
temp = slope * i;
progstruct[i] = (int)temp;
Manual Number: 00650-010-6
i;
rads,sine;
Calculate the points to create a trinagle wave
None
None
None
i;
slope,temp;
/*no point -- no curve */
/* no counts -- no curve */
/* waveform slope */
/* rad per count */
Page 25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Aob16/16

Table of Contents