[SIMPLE PROGRAM] HYT humidity & temp sensor polling / showing received data at TFT with capacitive touchscreen

Dependencies:   FT800_2 HYT mbed

HYT humidity and temperature sensor polling & showing received data at TFT via graphical controller FT800/FT801.

Hardware

For documentation on the FT800 library, please refer to the library pages.

Connection

MCU-board to TFT-module

MCU-board is connected to TFT-module via Break Out Board. You need 6 signals to connect: SCK, MOSI and MISO are connected to a SPI channel, SS is the chip select signal, PD work as powerdown and INT for interrupts from TFT to MCU.

/media/uploads/Ksenia/4_-22-.jpg

You have to connect VDD to BLVDD at Break Out Board if you use the board:

/media/uploads/Ksenia/4_-5-.jpg

MCU-board to HYT sensor

MCU-board is connected to sensor via I2C. Remember to use pull-up resisrors there:

/media/uploads/Ksenia/freshpaint-20-2016.09.16-10.37.03.png

Подробнее в статьях Как перестать бояться и полюбить mbed [Часть 1 - 5] на https://habrahabr.ru/users/uuuulala/topics/

Committer:
Ksenia
Date:
Wed Oct 05 10:06:54 2016 +0000
Revision:
1:e20b5da0c912
Parent:
0:1f5444f2977d
Changed wrong comment in GetTouch function

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Ksenia 0:1f5444f2977d 1 #include "display.h"
Ksenia 0:1f5444f2977d 2
Ksenia 0:1f5444f2977d 3 /**************************************************************************************************************************
Ksenia 0:1f5444f2977d 4 ************************** Start display list *****************************************************************************
Ksenia 0:1f5444f2977d 5 **************************************************************************************************************************/
Ksenia 0:1f5444f2977d 6 void Display::StartDL()
Ksenia 0:1f5444f2977d 7 {
Ksenia 0:1f5444f2977d 8 (*_TFT).DLstart();
Ksenia 0:1f5444f2977d 9 // set white color for background
Ksenia 0:1f5444f2977d 10 (*_TFT).DL(CLEAR_COLOR_RGB(255, 255, 255));
Ksenia 0:1f5444f2977d 11 // clear buffers for preset values
Ksenia 0:1f5444f2977d 12 (*_TFT).DL(CLEAR(1, 1, 1));
Ksenia 0:1f5444f2977d 13 }
Ksenia 0:1f5444f2977d 14
Ksenia 0:1f5444f2977d 15 /**************************************************************************************************************************
Ksenia 0:1f5444f2977d 16 ************************** Finish display list ****************************************************************************
Ksenia 0:1f5444f2977d 17 **************************************************************************************************************************/
Ksenia 0:1f5444f2977d 18 void Display::FinishDL()
Ksenia 0:1f5444f2977d 19 {
Ksenia 0:1f5444f2977d 20 (*_TFT).DL(DISPLAY());
Ksenia 0:1f5444f2977d 21 // Swap the current display list
Ksenia 0:1f5444f2977d 22 (*_TFT).Swap();
Ksenia 0:1f5444f2977d 23 // Download the command list into fifo TFT
Ksenia 0:1f5444f2977d 24 (*_TFT).Flush_Co_Buffer();
Ksenia 0:1f5444f2977d 25 // Wait for the complete consumption of FT800 Coprocessor commands
Ksenia 0:1f5444f2977d 26 (*_TFT).WaitCmdfifo_empty();
Ksenia 0:1f5444f2977d 27 }