RTC
®
4 PC Interface Board
Rev. 1.3 e
9Software
66
set_laser_delays(100, // laser on delay in microseconds
100); // laser off delay in microseconds
set_jump_speed(1000.0); // jump speed in bits per milliseconds
set_mark_speed(250.0); // marking speed in bits per milliseconds
set_end_of_list();
execute_list(1);
// Draw
draw(square, POLYGONSIZE(square));
draw(triangle, POLYGONSIZE(triangle));
// Finish
printf("Finished - press any key to terminate ");
while(!kbhit()) ;
(void)getch();
printf("\n");
return;
}
// draw
//
// Description:
//
// Function "draw" transfers the specified figure to the RTC4 and invokes
// the RTC4 to mark that figure, when the transfer is finished. "draw" waits
// as long as the marking of a previously transferred figure is finished before
// it starts to transfer the specified figure.
//
//
// Parameter Meaning
//
// figure Pointer to a polygon array
// The first element of that array specifies the first location
// from where the figure will be marked until the last location,
// which is specified by the last array element.
//
// size Amount of polygons the polygon array contains
// In case "size" equals 0, the function immediately returns
// without drawing a line.
//
// Comment
// This function demonstrates the usage of a single list. Using list 1 only
// means that you can utilize the space of both lists, which equals 8000 entries
// totally.
//
// NOTE
// Make sure that "size" is smaller than 8000.
void draw(polygon *figure, unsigned size) {
unsigned short busy, position;
unsigned i;
if(size) {
do {
get_status(&busy, &position);
} while(busy);
// Only, use list 1, which can hold up to 8000 entries
set_start_list(1);
jump_abs(figure->xval, figure->yval);
for(i = 0, figure++; i < size - 1; i++, figure++)
mark_abs(figure->xval, figure->yval);
set_end_of_list();
execute_list(1);
}
}