Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BSP_DISCO_F746NG BME280
main.cpp
- Committer:
- inistol
- Date:
- 2020-01-13
- Revision:
- 0:3f09104467d2
File content as of revision 0:3f09104467d2:
#include "mbed.h"
#include "stm32746g_discovery_lcd.h"
#include "stm32746g_discovery_ts.h"
#include "BME280.h"
Serial pc(USBTX, USBRX);
#if defined(TARGET_LPC1768)
BME280 sensor(PB_9, PB_8);
#else
BME280 sensor(I2C_SDA, I2C_SCL);
#endif
TS_StateTypeDef TS_State;
float x=0;
uint8_t y=0;
uint8_t text[30];
uint8_t idx;
int main()
{
BSP_LCD_Init();
BSP_LCD_LayerDefaultInit(LTDC_ACTIVE_LAYER, LCD_FB_START_ADDRESS);
BSP_LCD_SelectLayer(LTDC_ACTIVE_LAYER);
BSP_LCD_Clear(LCD_COLOR_BLACK);
while (1) {
BSP_LCD_SetBackColor(LCD_COLOR_BLACK);
BSP_LCD_SetTextColor(LCD_COLOR_ORANGE);
x = sensor.getTemperature();
y = sensor.getPressure();
sprintf((char*)text, "%2.2f degC",x);
BSP_LCD_DisplayStringAt(0, LINE(idx+1), (uint8_t *)&text, CENTER_MODE);
//HAL_Delay(500);
}
}