k

Dependencies:   MAX30003 max32630fthr DS1307

Files at this revision

API Documentation at this revision

Comitter:
parthsagar2010
Date:
Tue Dec 21 01:36:53 2021 +0000
Parent:
23:288c5d1babd1
Commit message:
k

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 288c5d1babd1 -r feecfa7ea003 main.cpp
--- a/main.cpp	Tue Aug 03 19:39:42 2021 +0000
+++ b/main.cpp	Tue Dec 21 01:36:53 2021 +0000
@@ -18,15 +18,15 @@
 void task_fast(void);
 //DigitalOut ledA(LED2);
  
-DigitalOut S0(P4_0);
-DigitalOut S1(P5_6);
+DigitalOut S0(P0_4);
+DigitalOut S1(P0_5);
 //DigitalOut S2(P7_2);
 //DigitalOut S3(P7_2);
 
 //channel feedback
-DigitalIn A(P6_0); //P17
-DigitalIn B(P3_5); //P18
-DigitalIn C(P3_4); //P19
+DigitalIn A(P1_3); //P17
+DigitalIn B(P1_4); //P18
+DigitalIn C(P1_5); //P19
 
  
 void ecg_config(MAX30003 &ecgAFE);
@@ -87,7 +87,7 @@
     const int ETAG_BITS_MASK = 0x7;
     
   //  timer_fast.start();
-    DigitalOut rLed(LED2, LED_ON);
+     DigitalOut rLed(P0_6);
 //    pc.baud(9600);
     
     //pc.set_baud(115200);                    // Baud rate = 115200
@@ -135,6 +135,7 @@
     uint8_t p_4 = 0;
    // uint8_t channel_num= 1;
     uint8_t channel_num[1]= {0};
+    uint8_t battery_level[1] ={90};
     uint8_t data_len_1 = 0;
     uint8_t data_len_2 = 0;
     uint32_t packet_1 = 0;
@@ -199,7 +200,7 @@
     {
        
     
-    if ((onesec_counter>=112))
+    if ((onesec_counter>=125))
     {
       tic++;
         
@@ -225,6 +226,8 @@
       
       pc.write((uint8_t *)channel_num, sizeof(channel_num));
       
+      pc.write((uint8_t *)battery_level, sizeof(battery_level));
+       
       onesec_counter_temp = onesec_counter * 2;
       data_len_1 = onesec_counter_temp & 0xff;
       data_len_2 = (onesec_counter_temp >> 8) & 0xff;
@@ -254,7 +257,7 @@
     //  timer_fast.reset();
     
     
-       if (tic==10)       //C1    
+       if (tic==60)       //C1    
      {
       S0=1; 
       S1=0;
@@ -262,7 +265,7 @@
    //   S3=0;
      channel_num[0]= {1};
      } 
-     if (tic==20)    //C2
+     if (tic==120)    //C2
      {
       S0=0; 
       S1=1;
@@ -271,7 +274,7 @@
       channel_num[0]= {2};
       }
          
-     if (tic==30)          // C0  
+     if (tic==180)          // C0  
      {
       S0=0; 
       S1=0;
@@ -307,13 +310,6 @@
     //  S3=0;
       channel_num[0]= {2};}
      
-     
-    
-    
-    
-    
-    
-    
     
        } 
         // Read back ECG samples from the FIFO