Greenhouse Climate Observation Module

Dependencies:   BSP_DISCO_F746NG DHT

Committer:
chri721u
Date:
Fri Jan 31 10:32:08 2020 +0000
Revision:
2:739ba85b7a90
Parent:
0:a5831f680465
Child:
3:c21057907d21
Working Day/Night Cycle

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chri721u 2:739ba85b7a90 1 /*
chri721u 2:739ba85b7a90 2 Author: Christian Andresen
chri721u 2:739ba85b7a90 3 Date: 13/01/2020
chri721u 2:739ba85b7a90 4
chri721u 2:739ba85b7a90 5 Brief:
chri721u 2:739ba85b7a90 6 Bootup screen for the STM32-756g_Discovery LCD monitor.
chri721u 2:739ba85b7a90 7 */
chri721u 0:a5831f680465 8 #include "mbed.h" // Mbed header from mbed-os version 5
chri721u 0:a5831f680465 9 #include "stm32746g_discovery_lcd.h" // Last updated 27/11/2019
chri721u 0:a5831f680465 10 #include "bootup.h"
chri721u 0:a5831f680465 11
chri721u 0:a5831f680465 12 void bootup::LCD_Bootup()
chri721u 0:a5831f680465 13 {
chri721u 0:a5831f680465 14 // Boot up LCD screen
chri721u 0:a5831f680465 15 BSP_LCD_Init(); // Starts up the LCD
chri721u 0:a5831f680465 16 BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS);
chri721u 0:a5831f680465 17 BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
chri721u 0:a5831f680465 18
chri721u 0:a5831f680465 19 // Clear the screen, add black background and red text
chri721u 0:a5831f680465 20 BSP_LCD_Clear(LCD_COLOR_BLACK);
chri721u 0:a5831f680465 21 BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
chri721u 0:a5831f680465 22 BSP_LCD_SetTextColor(LCD_COLOR_RED);
chri721u 0:a5831f680465 23
chri721u 0:a5831f680465 24 // Bootup Message
chri721u 0:a5831f680465 25 printf("Device is booting up \r\n"); // Debug statement that lets you know that the device is booting.
chri721u 0:a5831f680465 26 BSP_LCD_DisplayStringAt(0, 100, (uint8_t *) "HELLDROP GREENHOUSES", CENTER_MODE); // Company
chri721u 0:a5831f680465 27 BSP_LCD_DisplayStringAt(0, 150, (uint8_t *) "BIG HARD PLANTS", CENTER_MODE); // Tagline 1
chri721u 0:a5831f680465 28 BSP_LCD_DisplayStringAt(0, 175, (uint8_t *) "IN A BIG HARD GREENHOUSE", CENTER_MODE); // Tagline 2
chri721u 2:739ba85b7a90 29 HAL_Delay(1000); // Delay 1 second to simulate actual bootup
chri721u 0:a5831f680465 30 // Prep for display
chri721u 0:a5831f680465 31 BSP_LCD_Clear(LCD_COLOR_BLACK);
chri721u 0:a5831f680465 32 BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
chri721u 0:a5831f680465 33 BSP_LCD_SetTextColor(LCD_COLOR_RED);
chri721u 0:a5831f680465 34 }