#include #include #include /* John L. Sokol http://www.unixprogram.com Program to set bit on printer port of PC. works with R2R ladder D/A converted from http://www.dnull.com/zebraresearch/images/Schematic0.jpg See Audio Byte site at http://www.dnull.com/zebraresearch/ this code generates a triangle wave output.. Tested in Via EPIA M10000 with FreeBSD 4.9 and 4.11 */ main(){ int file; long a,b; file = open( "/dev/io",O_RDWR); for(;;){ for(b=0; b < 255; b += 1){ for(a=0; a < 20000; a++) {} outb(0x378,b); } for(; b > 0; b -= 1){ for(a=0; a < 20000; a++) {} outb(0x378,b); } } }