Inductance caculator
#include<iostream.h>
#include<math.h>
#include<conio.h>
using namespace std;
unsigned short int bit;
double c,l,fre,rad,Tmax,Tmin=0.5e-6;
unsigned short int res;
double ind(double);
int main(int argc, char *argv[])
{
cout<<"INDUCTANCE METER CACULATOR\n";
cout<<"**************************\n";
cout<<"8MHZ Fosc is used \nTcyc= 0.5e-6 sec\n ";
cout<<"Select timer mode.\n";
cout<<"for 8 bit mode enter 8\nfor 16 bit mode enter 16\nbit:";
cin>>bit;
res=pow(2,bit)-1;
Tmax=res*Tmin;
cout<<"\nResolution="<<res;
std::cout<<std::scientific;
cout<<"\nTmin="<<Tmin<<" s";
cout<<"\nTmax="<<Tmax<<" s";
cout<<"\nEnter ref cap(farad):";
cin>>c;
cout<<"\n\nYou Entered"<<endl;
//cout<<"L="<<l<<endl;
cout<<"C="<<c<<endl;
cout<<endl;
cout<<"Lmin="<<ind(Tmin)<<endl;
cout<<"Lmax="<<ind(Tmax);
}
double ind(double t)
{
return ((1/c)*pow((t/(2*3.14)),2));
}
Comments
Post a Comment