i

Dependencies:   Encoder HIDScope MODSERIAL TextLCD mbed-dsp mbed

Fork of Main-script_groep7_V2 by Laura Heus

Files at this revision

API Documentation at this revision

Comitter:
phgbartels
Date:
Mon Nov 03 15:15:31 2014 +0000
Parent:
11:687aa4656a6e
Child:
13:95a4bb9daf63
Commit message:
Werkend script met nieuwe LCD regelaar

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Nov 03 14:46:31 2014 +0000
+++ b/main.cpp	Mon Nov 03 15:15:31 2014 +0000
@@ -46,6 +46,8 @@
 MODSERIAL pc(USBTX,USBRX);
 HIDScope scope(3);
 AnalogIn emg(PTB1);
+
+Timer statetimer;
 /*
 definieer namen aan var, float, int, static float, uint8_t, uint16_t etc. en geef ze eventueel een waarde
 */
@@ -338,7 +340,9 @@
 
 void statemachinefunction()
 {
-    pc.printf(".");
+    pc.printf("_%d_",statetimer.read_us());
+    statetimer.reset();
+    //pc.printf(".");
     switch(state) {
         case RUST: {
             rust();
@@ -422,6 +426,7 @@
 
         case INSTELLEN_RICHTING: {
             instellen_richting();
+            
             /*if (current_herhalingen == 100)
             {
                 current_herhalingen_1 = 0;
@@ -611,7 +616,7 @@
         lcd.locate(0,0);
         lcd.printf("Instellen hoek");
         lcd.locate(0,1);
-        lcd.printf("Even ");
+        lcd.printf("Even wachten...");
         pc.printf("e");
     }//else if(state==INSTELLEN_RICHTING){
 
@@ -640,11 +645,16 @@
 int main()
 {
     pc.baud(115200);
+    statetimer.start();
     arm_biquad_cascade_df1_init_f32(&lowpass_1,1 , lowpass_1_const, lowpass_1_states);
     arm_biquad_cascade_df1_init_f32(&highpass,1 , highpass_const, highpass_states);
     arm_biquad_cascade_df1_init_f32(&notch,1 , notch_const, notch_states);
     arm_biquad_cascade_df1_init_f32(&lowpass_2,1 , lowpass_2_const, lowpass_2_states);
     statemachine.attach(&statemachinefunction, TSAMP); // the address of the function to be attached (flip) and the interval (2 seconds)
-    screen.attach(&screenupdate, 0.2);
-    while(1);
+    //screen.attach(&screenupdate, 0.2);
+    while(1)
+    {
+        screenupdate();
+        wait(0.2);
+    };
 }
\ No newline at end of file