Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 27th, 2003, 03:27 PM
tps tps is offline
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default NEED HELP FOR THIS SOFTWARE

DEAR THIS SOFTWARE IS FOR PC BASED FREQUENCY MEASURMENT WRITTEN IN TURBO "C" .HELP IT HAS ONLY ONE ERROR

#include
#include
#include
#define MOD 16 /* define counter mod used */
#define LPT 0x379/* LPT1 input port address */
void interrupt(*old_clock)();
void interrupt new_clock();
static int t;
void main()
{ /* tick = Time for which LPT will be read */
float div,mul,tick=54800.0; /* tick is in micro sec. */
double fq,tm,pri;
char data[50000],c;
int count,ls,ps,k,j,N,st;
unsigned i;
old_clock=getvect(0x08);///* capturing time vector */
setvect(0x08,new_clock); /* assigning new time time vector */
do
{ i=0; t=0; clrscr();
gotoxy(25,1); printf("FREQUENCY MEASUREMENT");
gotoxy(23,17); printf("Press any key to pause.....");
while(!kbhit()) /* reading LPT between two time interrupts */
{ /* use "int(LPT)" if using MS product */
while(t2&&t2;k-)
/* analyzing each bit of read data */
{ N=1;
for(j=0;j0&&st<4) count++;
if(st==3)break;/* wave found */
ls=ps;
}
if(st==3) /* calculate frequency of the wave */
{mul=1;for(j=3;jprintf("%d %f %d ",k,mul,count);
tm=((count*div)/mul); fq=1/tm; pri=(100.0/count);
gotoxy(20,7); printf("Frequency = %0.3lf Kilo Hz ", fq*1000);
gotoxy(20,10); printf("Time = %0.3lf micro sec ", tm);
gotoxy(15,23); printf("Precision = %0.5lf percent of main frequency",pri);
gotoxy(15,24); printf("Samples taken in %0.2f ms = %d ", tick/1000,i);
break;
}
if(st<3 && k==3)/* no complete wave was present */
{ gotoxy(24,7); printf("Error in Reading...!");
}
}} t=0; i=0;
}

getch(); gotoxy(13,21);
printf(" Press E Esc for Exit any key other to continue");
c=getch();
}
while (c!=27&&c!='e'&&c!='E');
setvect(0x08,old_clock); /* assigning original time interrupt */
}
void interrupt new_clock() /* new time interrupt service */
{ t++; (*old_clock)();}






TPS PROJECTS





Similar Threads
Thread Thread Starter Forum Replies Last Post
Using C++ for Application software vicky_prudhvi C++ Programming 0 April 3rd, 2007 02:06 AM
Multilanguage software tiyyob .NET Framework 2.0 1 June 14th, 2006 08:51 AM
best WWW Authoring Software (FREE!) software crmpicco HTML Code Clinic 2 July 18th, 2005 03:37 AM
Software usage rajesh@sonimtech.com C++ Programming 0 October 15th, 2004 06:30 PM
Is there a Software jmss66 Classic ASP Basics 6 January 7th, 2004 05:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.