Alexandru Radu
/
RD117_LCD_copy
gg
Fork of RD117_MBED by
Diff: main.cpp
- Revision:
- 5:ad4ccdc49727
- Parent:
- 4:5273ab1085ab
--- a/main.cpp Thu May 19 22:04:06 2016 +0000 +++ b/main.cpp Tue May 02 08:45:41 2017 +0000 @@ -74,6 +74,9 @@ #include "mbed.h" #include "algorithm.h" #include "MAX30102.h" +#include "TextLCD.h" + +TextLCD lcd(PTC9, PTD3, PTD2, PTD0, PTD5, PTA13); // rs, e, d4-d7 #define MAX_BRIGHTNESS 255 @@ -120,7 +123,10 @@ { pc.printf("\x1B[2J"); //clear terminal program screen pc.printf("Press any key to start conversion\n\r"); + lcd.cls(); + lcd.printf(" Press any key to start\n"); wait(1); + lcd.cls(); } uch_dummy=getchar(); @@ -148,7 +154,15 @@ pc.printf("%i", aun_red_buffer[i]); pc.printf(", ir="); pc.printf("%i\n\r", aun_ir_buffer[i]); + + + lcd.cls(); + lcd.printf(" red=%i\n", aun_red_buffer[i]); + + lcd.printf(" ir=%i", aun_ir_buffer[i]); + } + un_prev_data=aun_red_buffer[i]; @@ -212,6 +226,17 @@ pc.printf("HRvalid=%i, ", ch_hr_valid); pc.printf("SpO2=%i, ", n_sp02); pc.printf("SPO2Valid=%i\n\r", ch_spo2_valid); + + lcd.cls(); + //lcd.printf("red="); + //cd.printf("%i", aun_red_buffer[i]); + //lcd.printf("ir="); + //lcd.printf("%i\n\r", aun_ir_buffer[i]); + lcd.printf("HR=%i ", n_heart_rate); + lcd.printf("HRv=%i\n", ch_hr_valid); + lcd.printf("SpO2=%i ", n_sp02); + lcd.printf("SP2V=%i", ch_spo2_valid); + } maxim_heart_rate_and_oxygen_saturation(aun_ir_buffer, n_ir_buffer_length, aun_red_buffer, &n_sp02, &ch_spo2_valid, &n_heart_rate, &ch_hr_valid); }