Non-variable (TESTEDandWORKING)

Dependencies:   mbed-rtos mbed

Fork of ELEC347_Coursework by CMST

Revision:
2:f6e49378dd8a
Parent:
1:b088b771a591
Child:
3:36d6642c2c45
--- a/main.cpp	Tue Nov 28 09:41:07 2017 +0000
+++ b/main.cpp	Tue Nov 28 09:51:30 2017 +0000
@@ -14,7 +14,9 @@
 Thread T1;
 Thread T2;
 
-FILTER BP_filter(35000,4000,2,2);  //Create object of type Filter(Fs,Fo,Boost,Q)
+float input = 0.0;
+FILTER BP_filter(48000,10,16,1600);  //Create object of type Filter(Fs,Fo,Boost,Q)
+
 
 void sampler(void);
 
@@ -22,14 +24,12 @@
 int main()
 {
     
-    
+    BP_filter.Define_Filter();
     float sample_rate = (1.0/35000) ;
-    sample_timer.attach(&sampler,sample_rate);
-    
-    
+    sample_timer.attach(&sampler,sample_rate);;
 
     while(1) {
-        sleep();
+
     }
 }
 
@@ -39,7 +39,7 @@
 
     SampLED = 1;                        //LED Indicates start of sampling
 
-    float input = Ain;
+    input = Ain;
     BP_filter.setvalue(input);       //Input ADC. N.B. ADC in MBED is 0.0 to 1.0 float!!!!!!
     Aout = BP_filter.getvalue();
     
@@ -47,4 +47,3 @@
     SampLED = 0;      //LED Indicates end of sampling
 }
 
-https://os.mbed.com/users/thomasmorris/code/ELEC347_CourseWork/
\ No newline at end of file