Nucleo-transfer

Dependencies:   ADS1015 MPU6050 PixelArray-Nucleo mbed

Fork of Momo_Pilot_1 by Momo Medical

Files at this revision

API Documentation at this revision

Comitter:
Ishy
Date:
Mon Nov 27 15:47:43 2017 +0000
Parent:
40:a5614befa65f
Commit message:
Changed all pins;

Changed in this revision

Sensorplate/PixelArray.lib Show annotated file Show diff for this revision Revisions of this file
Sensorplate/main.cpp Show annotated file Show diff for this revision Revisions of this file
Sensorplate/mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/Sensorplate/PixelArray.lib	Thu Oct 26 15:34:40 2017 +0000
+++ b/Sensorplate/PixelArray.lib	Mon Nov 27 15:47:43 2017 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/JacobBramley/code/PixelArray/#47802e75974e
+https://os.mbed.com/teams/Momo/code/PixelArray-Nucleo/#b995e738b29d
--- a/Sensorplate/main.cpp	Thu Oct 26 15:34:40 2017 +0000
+++ b/Sensorplate/main.cpp	Mon Nov 27 15:47:43 2017 +0000
@@ -35,23 +35,23 @@
 #define NUMBER_LED_FRONT (3)  // declaren waarvoor dient                                                     
 #define ONE_COLOR
 
-InterruptIn button_lock(p15);                                                       // Input on intterupt base decleration. 
-InterruptIn button_reposition(p17);
-InterruptIn button_mute(p16);
-InterruptIn button_new_patient(p18);
+InterruptIn button_lock(PC_0);                                                       // Input on intterupt base decleration. 
+InterruptIn button_reposition(PC_1);
+InterruptIn button_mute(PC_2);
+InterruptIn button_new_patient(PC_3);
 
 DigitalOut  LED_on_dev_board1(LED1);                                                // Decleration of digital outputs.                                          
 DigitalOut  LED_on_dev_board2(LED2);
 DigitalOut  LED_on_dev_board3(LED3);
 DigitalOut  LED_on_dev_board4(LED4);
-DigitalOut speaker1(p21); // relatie aangeven!
-DigitalOut speaker2(p22);
-neopixel::PixelArray indicator_LEDs(p11);                                           
+DigitalOut speaker1(PC_8);               // relatie aangeven!
+DigitalOut speaker2(PC_6);
+neopixel::PixelArray indicator_LEDs(PA_7);                                           
 
-PwmOut lock_feedback_LED(p23);                                                      // Declaration of pulse with modulation outputs.                                
-PwmOut reposition_feedback_LED(p25);
-PwmOut mute_feedback_LED(p26);
-PwmOut new_patient_feedback_LED(p24);
+PwmOut lock_feedback_LED(PB_13);                                                      // Declaration of pulse with modulation outputs.                                
+PwmOut mute_feedback_LED(PB_1);
+PwmOut new_patient_feedback_LED(PB_14);
+PwmOut reposition_feedback_LED(PB_15);
 
 Timer button_lock_hold_timer;                                                       // Timer for time lock button should be pressed.
 Timer button_calibration_hold_timer;                                                // Timer for calibration function (new patient holding 5 seconds).
@@ -66,21 +66,21 @@
 -> This is because of using the same I2C line;
 -> For detailed information/questions about this item, please read the technical manual or contact: Ricardo Molenaar | ricardo.molenaar@gmail.com
 */
-I2C i2c_sensorplate_adc(p28, p27);                                                  // I2C for sensorplate.
-I2C i2c_power_adc(p9, p10);                                                         // I2C for accupack. 
-MPU6050 angle_device_sensorplate(p28,p27);                                          // i2c pins // i2c address hardcoded 0x68.
-MPU6050_belt angle_device_reference_belt(p28,p27);                                  // i2c pins // i2c address hardcoded 0x69.
+I2C i2c_sensorplate_adc(PB_9, PB_8);                                                  // I2C for sensorplate.
+I2C i2c_power_adc(PB_11, PB_10);                                                         // I2C for accupack. 
+MPU6050 angle_device_sensorplate(PB_9, PB_8);                                          // i2c pins // i2c address hardcoded 0x68.
+MPU6050_belt angle_device_reference_belt(PB_9, PB_8);                                  // i2c pins // i2c address hardcoded 0x69.
 Adafruit_ADS1115 piezo_resistive_adc1(&i2c_sensorplate_adc, 0x48);                  // i2c pins, i2c address.
 Adafruit_ADS1115 piezo_resistive_adc2(&i2c_sensorplate_adc, 0x49);                  // i2c pins, i2c address.
 Adafruit_ADS1115 piezo_electric_adc(&i2c_sensorplate_adc, 0x4B);                    // i2c pins, i2c address.
 Adafruit_ADS1115 adsAccu(&i2c_power_adc, 0x48);                                     // i2c pins, i2c address.
-Serial usb_serial(USBTX, USBRX);                                                    // tx, rx  
-Serial pi_serial(p13, p14);                                                         // tx, rx  
+Serial usb_serial(SERIAL_TX, SERIAL_RX);                                            // tx, rx  
+Serial pi_serial(PC_10, PC_11);                                                     // tx, rx  
 Ticker total_readout_cycle;                                                         // Polling cycle.
 // End of commentbox related to the serial configuration/ADC reading components. 
 
 int boot_delay_ms = 500;
-int total_readout_cycle_time_us = 100000;                                           // Cycle time in us.
+int total_readout_cycle_time_us = 100000 * 2;                                           // Cycle time in us.
 int i2c__frequency = 400000;                                                              // I2C Frequency.
 int baud_rate = 115200;                                                             // Baud rate.
 short piezo_resistive_array[8] = {0,0,0,0,0,0,0,0};                                 // 8 PR sensors 1 time per cycle.
@@ -111,13 +111,13 @@
 /*************************** TEST ********************************/
 // Verify algoritm function: for belt activation, set test_belt 1 (connect pin p20 to 3.3V).
 Timer test_timer;                                                           
-DigitalIn test_pin(p30, PullDown);
+DigitalIn test_pin(PA_11, PullDown);
 
 // Variable to set if belt is used to test algorithm: 
 bool test_belt = 0; 
 
 // Set test mode on (log functions to pc serial: interrupts, LED intensity and serial messages): 
-bool test_mode = 0;
+bool test_mode = 1;
 
 // Variable for connection test (should be changed):
 int connection_test_sensorplate; 
@@ -587,8 +587,7 @@
     }
 }   
 
-void read_adc()
-{
+void read_adc() {
     piezo_electric_sample_timer.reset();                                            // Clock gebruiken o.i.d.?
     piezo_electric_sample_timer.start();
     connection_test_sensorplate = angle_device_sensorplate.testConnection();
@@ -626,7 +625,7 @@
         angle_device_sensorplate.getAccelero(accelerometer_sensorplate);                // Get accelerometer data.
         angle = accelerometer_sensorplate[2]*100;
         if(angle == 0) {
-            MPU6050 angle_device_sensorplate(p28,p27);
+            MPU6050 angle_device_sensorplate(PB_9, PB_8);
             angle_device_sensorplate.getAccelero(accelerometer_sensorplate);
             angle = accelerometer_sensorplate[2]*100;
         }
@@ -673,7 +672,7 @@
     }
 
     while(piezo_electric_sample_timer.read_us()<(4.25*(total_readout_cycle_time_us/5))) {}  // Wait untill 85% of cycle. Energy efficiency is not fine in this situation, correct if low energy is needed.
-
+    
     serial_read();                                                                   // Call function for reading information from PI by serial connection. 
     serial_log();                                                                    // Call function for logging information to PI by serial connection. 
     
--- a/Sensorplate/mbed.bld	Thu Oct 26 15:34:40 2017 +0000
+++ b/Sensorplate/mbed.bld	Mon Nov 27 15:47:43 2017 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/users/mbed_official/code/mbed/builds/a330f0fddbec
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file