


#Arduino tft display code
This long part of code will draw the points of the graph at their values and then will join them through lines, the code checks if the canvas of the graph is filled up, if it is, it will start ejecting the first value of the graph and moving the others up to allow space for the new value to be inserted, if there is still space left, the device will keep adding values at intervals. Tft.fillRect((mark), (locationBlock - 1), markSize, markSize, pointColor) Tft.fillRect((originX + 2), (originY - sizeY), sizeX, sizeY, WHITE) Tft.drawLine(mark, locationBlock, mark, locationBlock, lineColor) Tft.fillRect((mark - 1), (locationBlock - 1), markSize, markSize, pointColor) LocationBlock = map(temp, 0, graphRange, originY, (originY - sizeY))

Tft.setCursor((mark - 5), (originY + 16)) This short line of code will read the temperature form the DHT 11 sensor and will then store it in a variable. This part of the code will draw the outline of the graph, it will draw the x and y axis lines, it will also draw the marks and will label the y axis with values. Tft.setCursor((minorSizeX - 30), (number + numberSize)) Tft.drawLine(originX, (originY - number), minorSizeX, (originY - number), graphColor) Tft.drawLine(mark, originY, mark, minorSizeY, graphColor) Tft.drawLine(originX, originY, originX, (originY - sizeY), graphColor) Tft.drawLine(originX, originY, (originX + sizeX), originY, graphColor) Tft.setTextSize(4) // set the size of the text Tft.setTextColor(BLUE) // set the colour of the text
