Nucleo-transfer
Dependencies: ADS1015 MPU6050 PixelArray PixelArray-Nucleo mbed WS2813
Fork of Nucleo-transfer by
Diff: Sensorplate/main.cpp
- Revision:
- 57:fac732476810
- Parent:
- 56:97dea631c5f2
- Child:
- 58:8cfa736d8553
--- a/Sensorplate/main.cpp Wed Feb 28 09:33:58 2018 +0000 +++ b/Sensorplate/main.cpp Wed Feb 28 10:03:09 2018 +0000 @@ -46,7 +46,7 @@ DigitalIn intensity_code(PA_12); DigitalIn colour_code_1(PA_11); DigitalIn colour_code_0(PB_12); -DigitalIn testpin_sensorplate(PC_6); +InterruptIn testpin_sensorplate(PC_6); DigitalOut LED_on_dev_board1(LED1); // Decleration of digital outputs. DigitalOut LED_on_dev_board2(LED2); @@ -666,8 +666,15 @@ } } +void sensorplate_detached() +{ + NVIC_SystemReset(); +} + + int main() // Main function. inline function "Momo Init" bijvoorbeeld { + serial_read(); ws.useII(WS2812::GLOBAL); // use global intensity scaling set_intensity_LEDs(); // Initialize intensity for user interface LED's and LED's shines to wall. colour_select_indicating_LED_wall(LED_colour); @@ -683,11 +690,13 @@ piezo_electric_adc.setGain(GAIN_TWO); pi_serial.format(8, SerialBase::None, 1); // Set serial communication line with PI. + testpin_sensorplate.mode(PullUp); button_lock.mode(PullUp); button_reposition.mode(PullUp); button_mute.mode(PullUp); button_new_patient.mode(PullUp); + testpin_sensorplate.fall(&sensorplate_detached); button_lock.fall(&trigger_lock); // Interrupt for rising edge lock button. button_lock.rise(&end_timer_lock_button); button_reposition.fall(&reposition_button_triggered);