Nucleo-transfer
Dependencies: ADS1015 MPU6050 PixelArray PixelArray-Nucleo mbed WS2813
Fork of Nucleo-transfer by
Diff: Sensorplate/main.cpp
- Revision:
- 39:cff99a9b7237
- Parent:
- 38:764847892afc
- Child:
- 40:a5614befa65f
--- a/Sensorplate/main.cpp Thu Oct 26 13:54:51 2017 +0000 +++ b/Sensorplate/main.cpp Thu Oct 26 15:33:07 2017 +0000 @@ -81,7 +81,7 @@ int boot_delay_ms = 500; int total_readout_cycle_time_us = 100000; // Cycle time in us. -int i2c_frequency = 400000; // I2C Frequency. +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. short piezo_electric_array[5] = {0,0,0,0,0}; // 1 PE sensor 5 times per cycle. @@ -303,10 +303,10 @@ if (connection_test_sensorplate == 1) { // If statement for sending serial information sensorplate data when connection test is active. // Receiving order sensor information: 8 resistive sensors, 5 electric readings. Is splitted in two parts - part 1/2. - pi_serial.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n", piezo_resistive_array[4], piezo_resistive_array[7], piezo_resistive_array[6], piezo_resistive_array[5], piezo_resistive_array[1], piezo_resistive_array[0], piezo_resistive_array[2], piezo_resistive_array[3], piezo_electric_array[0], piezo_electric_array[1], piezo_electric_array[2], piezo_electric_array[3], piezo_electric_array[4]); // print all to serial port + pi_serial.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n", piezo_resistive_array[0], piezo_resistive_array[1], piezo_resistive_array[2], piezo_resistive_array[3], piezo_resistive_array[4], piezo_resistive_array[5], piezo_resistive_array[6], piezo_resistive_array[7], piezo_electric_array[0], piezo_electric_array[1], piezo_electric_array[2], piezo_electric_array[3], piezo_electric_array[4]); // print all to serial port if (test_mode == 1) { - usb_serial.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n", piezo_resistive_array[4], piezo_resistive_array[7], piezo_resistive_array[6], piezo_resistive_array[5], piezo_resistive_array[1], piezo_resistive_array[0], piezo_resistive_array[2], piezo_resistive_array[3], piezo_electric_array[0], piezo_electric_array[1], piezo_electric_array[2], piezo_electric_array[3], piezo_electric_array[4]); // print all to serial port + usb_serial.printf("!,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\n", piezo_resistive_array[0], piezo_resistive_array[1], piezo_resistive_array[2], piezo_resistive_array[3], piezo_resistive_array[4], piezo_resistive_array[5], piezo_resistive_array[6], piezo_resistive_array[7], piezo_electric_array[0], piezo_electric_array[1], piezo_electric_array[2], piezo_electric_array[3], piezo_electric_array[4]); // print all to serial port } } @@ -658,9 +658,9 @@ } uint32_t val = 0; - colour_select_indicating_LED_wall(LED_colour); // Function to select colour. + colour_select_indicating_LED_wall(LED_colour); // Function to select colour. indicator_LEDs.update(generate, NUMBER_LED_FRONT, val); // Function to set the LED's which shines to the wall (indicating change patient position). - set_userinterface_LED(); // Set LED's of user interface (LED's above buttons). + set_userinterface_LED(); // Set LED's of user interface (LED's above buttons). while(piezo_electric_sample_timer.read_us()<(4*(total_readout_cycle_time_us/5))) {} // Wait untill 80% of cycle. Energy efficiency is not fine in this situation, correct if low energy is needed. @@ -697,8 +697,8 @@ int main() { // Main function. inline function "Momo Init" bijvoorbeeld wait_ms(boot_delay_ms); // Wait to boot sensorplate first. - i2c_sensorplate_adc.frequency(i2c_frequencyuencyuency); // Set frequency for i2c connection to sensorplate (variable is declared in config part). - i2c_power_adc.frequency(i2c_frequencyuencyuency); // Same as line 695, but now for ADC to read battery- en powervoltage. + i2c_sensorplate_adc.frequency(i2c__frequency); // Set frequency for i2c connection to sensorplate (variable is declared in config part). + i2c_power_adc.frequency(i2c__frequency); // Same as line 695, but now for ADC to read battery- en powervoltage. usb_serial.baud(baud_rate); // Set serial USB connection baud rate (variable is declared in config part). pi_serial.baud(baud_rate); // Same as line 697, but now for serial PI connection. piezo_resistive_adc1.setGain(GAIN_TWOTHIRDS); // Set ranges of ADC to +/-6.144V (end is marked with #):