Miguel Angel Caycho
/
Pruebas_Ventilador_Eplimin_01_Backup
para el ventilador
main.cpp@9:95fdcdc0977e, 2020-04-26 (annotated)
- Committer:
- miguelangel_2511
- Date:
- Sun Apr 26 08:50:12 2020 +0000
- Revision:
- 9:95fdcdc0977e
- Parent:
- 8:208d965a3bd2
- Child:
- 11:5cb7ae8bd831
Prueba del ventilador con las graficas de volumen, flujo y presion. Aun no se ha tomado en cuenta la influencia del tiempo de impresion sobre la frecuencia de muestreo eficaz.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
miguelangel_2511 | 0:9d0b9785d3d6 | 1 | #include "mbed.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 2 | #include "stdint.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 3 | #include "project_defines.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 4 | #include "buttons.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 5 | #include "encoder_interface.h" |
miguelangel_2511 | 6:d38287621cca | 6 | #include "nextion_interface.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 7 | #include "stepper_motor_driver.h" |
miguelangel_2511 | 7:f4e248182d31 | 8 | #include "pressure_sensors.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 9 | #include "ventilator.h" |
miguelangel_2511 | 0:9d0b9785d3d6 | 10 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 11 | |
miguelangel_2511 | 8:208d965a3bd2 | 12 | int main(void) { |
miguelangel_2511 | 8:208d965a3bd2 | 13 | |
miguelangel_2511 | 8:208d965a3bd2 | 14 | System_Initialize(); |
miguelangel_2511 | 0:9d0b9785d3d6 | 15 | |
miguelangel_2511 | 9:95fdcdc0977e | 16 | while(1){ |
miguelangel_2511 | 9:95fdcdc0977e | 17 | |
miguelangel_2511 | 9:95fdcdc0977e | 18 | Nextion_Encoder_Interaction(); |
miguelangel_2511 | 1:aa5df1878126 | 19 | Stepper_Driver_State_Machine(); |
miguelangel_2511 | 7:f4e248182d31 | 20 | |
miguelangel_2511 | 7:f4e248182d31 | 21 | if(read_pressure_sensors_flag){ |
miguelangel_2511 | 7:f4e248182d31 | 22 | Pressure_Sensors_Read(); |
miguelangel_2511 | 8:208d965a3bd2 | 23 | Calculate_Flow_From_Pressure(); |
miguelangel_2511 | 8:208d965a3bd2 | 24 | Calculate_Volume_From_Flow(); |
miguelangel_2511 | 7:f4e248182d31 | 25 | read_pressure_sensors_flag = 0; |
miguelangel_2511 | 7:f4e248182d31 | 26 | } |
miguelangel_2511 | 8:208d965a3bd2 | 27 | |
miguelangel_2511 | 7:f4e248182d31 | 28 | if((stepper_driver_state != Stepper_Inspiration_Finish) && |
miguelangel_2511 | 7:f4e248182d31 | 29 | (stepper_driver_state != Stepper_Expiration_Finish)){ |
miguelangel_2511 | 8:208d965a3bd2 | 30 | /* Display sensed values if necessary */ |
miguelangel_2511 | 7:f4e248182d31 | 31 | if(pressure_sensor_display_update_flag){ |
miguelangel_2511 | 8:208d965a3bd2 | 32 | Nextion_Update_Sensor_Values(); |
miguelangel_2511 | 8:208d965a3bd2 | 33 | pressure_sensor_display_update_flag = 0; |
miguelangel_2511 | 7:f4e248182d31 | 34 | } |
miguelangel_2511 | 8:208d965a3bd2 | 35 | /* Plot sensed values if necessary */ |
miguelangel_2511 | 7:f4e248182d31 | 36 | if(pressure_sensor_waveform_update_flag){ |
miguelangel_2511 | 7:f4e248182d31 | 37 | Nextion_Update_Waveform_Values(); |
miguelangel_2511 | 7:f4e248182d31 | 38 | pressure_sensor_waveform_update_flag = 0; |
miguelangel_2511 | 8:208d965a3bd2 | 39 | } |
miguelangel_2511 | 7:f4e248182d31 | 40 | |
miguelangel_2511 | 8:208d965a3bd2 | 41 | } |
miguelangel_2511 | 0:9d0b9785d3d6 | 42 | } |
miguelangel_2511 | 0:9d0b9785d3d6 | 43 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 44 | return 0; |
miguelangel_2511 | 0:9d0b9785d3d6 | 45 | } |
miguelangel_2511 | 0:9d0b9785d3d6 | 46 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 47 | |
miguelangel_2511 | 0:9d0b9785d3d6 | 48 | |
miguelangel_2511 | 8:208d965a3bd2 | 49 | |
miguelangel_2511 | 8:208d965a3bd2 | 50 | |
miguelangel_2511 | 8:208d965a3bd2 | 51 | |
miguelangel_2511 | 8:208d965a3bd2 | 52 | |
miguelangel_2511 | 8:208d965a3bd2 | 53 | |
miguelangel_2511 | 8:208d965a3bd2 | 54 |