iBreathe Breathalyzer can now talk thanks to the Text to Speech Click Board
Dependencies: Hexi_KW40Z Hexi_OLED_SSD1351 text_to_speak_mbed
Fork of iBreathe_Breathalyzer by
Diff: main.cpp
- Revision:
- 2:47c3dad2c8ef
- Parent:
- 1:42e8e50ae4ac
--- a/main.cpp Fri Aug 26 23:07:25 2016 +0000 +++ b/main.cpp Fri Aug 26 23:51:06 2016 +0000 @@ -3,6 +3,7 @@ #include "OLED_types.h" #include "OpenSans_Font.h" #include "string.h" +#include "images.h" int main() { char text[20]; /* Text Buffer */ @@ -32,13 +33,18 @@ /* Display text at (x=5,y=40) */ strcpy(text,"Timer(s):"); oled.Label((uint8_t *)text,5,40); - + /* Set text properties to white and right aligned for the dynamic text */ textProperties.fontColor = COLOR_WHITE; textProperties.alignParam = OLED_TEXT_ALIGN_RIGHT; oled.SetTextProperties(&textProperties); + + /* Adding Banner Image to bottom of screen */ + /* Setting pointer location of the 96 by 32 pixel bitmap */ + const uint8_t *image = NXP_banner_bmp; + /* Draws the image on the Screen starting at (x=0,y=64) */ + oled.DrawImage(image,0,64); - time.start(); /* start timer */ while (true) { @@ -47,7 +53,7 @@ sprintf(text,"%.2f",time.read()); /* Display time reading in 35px by 15px textbox at(x=55, y=40) */ - oled.TextBox((uint8_t *)text,55,40,35,15); + oled.TextBox((uint8_t *)text,55,40,35,15); /*Expand textbox for longer amount of time*/ Thread::wait(1000); }