{"id":474,"date":"2016-08-07T16:01:06","date_gmt":"2016-08-07T15:01:06","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=474"},"modified":"2016-08-07T16:01:06","modified_gmt":"2016-08-07T15:01:06","slug":"using-a-1-44-color-lcd-with-arduino-as-a-display","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/using-a-1-44-color-lcd-with-arduino-as-a-display\/","title":{"rendered":"Using a 1.44&#8243; Color LCD with Arduino as a display"},"content":{"rendered":"<p>Recently purchased a cheap color LCD from Ebay (<a href=\"http:\/\/www.ebay.com\/itm\/1-44-Red-Serial-128X128-SPI-Color-TFT-LCD-Module-Display-Replace-Nokia-5110-LCD-\/310876068105?hash=item4861a85909:g:9LoAAOSwpzdWqdY~\"><em>http:\/\/www.ebay.com\/itm\/1-44-Red-Serial-128X128-SPI-Color-TFT-LCD-Module-Display-Replace-Nokia-5110-LCD-\/310876068105?hash=item4861a85909:g:9LoAAOSwpzdWqdY~<\/em><\/a>). They are really good for displaying anything (from an Arduino perspective) in color.<\/p>\n<p>Though the are cheap and nice, but finding the proper library for them can be a pain. It would be wise to check the details of the LCD and availability of it&#8217;s library first before buying.<\/p>\n<p>What I found so far is there are mainly two types of LCDs that are cheaply available on Ebay. One based on the ILI9163 chipset and another based on the ST7735 chipset.<\/p>\n<p>Arduino IDE from version 1.0.5 onwards comes with a LCD library, which is based on the ST7735 chipset and an advancement of the Adafruit Libraries. Please see <a href=\"https:\/\/www.arduino.cc\/en\/Reference\/TFTLibrary\">this article<\/a> for more details.<\/p>\n<p>Using the LCD is not much complicated but only thing to remember is there is a huge lot of <em>confusion with which one supports what voltage and I\/O levels<\/em>. So with mine I started with 3.3v and things are working fine.<\/p>\n<pre class='wp-code-highlight prettyprint'>LED\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Connect to +ve supply through a resistor\r\nSCK \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 13 (fixed as per library)\r\nSDA \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 11 (fixed as per library)\r\nA0\/DC\u00a0\u00a0\u00a0\u00a0    7 (can be any)\r\nRESET \u00a0\u00a0     4\u00a0  (can be any)\r\nCS \u00a0\u00a0 \u00a0 \u00a0 \u00a0\u00a0 5 (can be any)\r\nGND         GND   \r\nVCC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 3.3v<\/pre>\n<p>There is one limitation to all libraries (I tested) at the moment, updating the texts on the display. The only way to clear the LCD is by calling the background function and painting the LCD with a color. This gives flicker, as a full screen text takes a bit time to get written fully. <span style=\"color: #ff0000;\">Yet to find a solution to this.<span style=\"color: #000000;\"> In the below code only the area that needs to be updated is being cleared. <\/span><\/span><\/p>\n<pre class='wp-code-highlight prettyprint'>#include &lt;SFE_BMP180.h&gt; \/\/from sparkfun \r\n#include &lt;Wire.h&gt;\r\n#include &lt;SoftwareSerial.h&gt;\r\n\r\n\/\/#include &lt;Adafruit_GFX.h&gt;\r\n#include &lt;TFT.h&gt; \/\/comes with Arduino IDE 1.0.5 onwards\r\n#include &lt;SPI.h&gt;\r\n\r\n\/\/ Define pins for ILI9163 SPI myDisplay\r\n#define __CS 5\r\n#define __DC 7 \/\/ Labeled as A0 in some modules\r\n#define __RST 6\r\n\/\/ Connect SDA to Arduino pin 11 (MOSI), and SCK to 13 (SCK)\r\n\r\nchar printBuffer[32];\r\n\r\n\/\/ Color definitions\r\n#define BLACK 0,0,0\r\n#define BLUE 0,0,255\r\n#define RED 255,0,0\r\n#define GREEN 0,255,0\r\n#define CYAN 0,255,255\r\n#define MAGENTA 255,0,255\r\n#define YELLOW 255,255,0 \r\n#define WHITE 255,255,255\r\n#define TRANSPARENT -1\r\nTFT myDisplay = TFT(__CS, __DC, __RST);\r\n\r\n\r\n\/\/#include &lt;dht11.h&gt;\r\n\/\/dht11 DHT11;\r\n\r\n\r\n#include \"DHT.h\"\r\n#define DHTPIN 2\r\n#define DHTTYPE DHT22\u00a0\u00a0 \/\/ DHT 22\u00a0 (AM2302), AM2321\r\nDHT dht(DHTPIN, DHTTYPE);\r\n\r\n\r\n#define _SS_MAX_RX_BUFF 128 \/\/ RX buffer size \/\/BEFORE WAS 64\r\n\r\n\r\nSoftwareSerial esp8266(8,7); \/\/RX,TX\r\n\r\nString inputBuffer = \"\";\r\nString slength;\r\nString sTemp;\r\nboolean stringComplete = false;\r\nint inputBufferIndex;\r\n\r\nString data1 = \"\"; \r\nString data2 = \"\";\r\nString data3 = \"\";\r\nString data5 = \"\";\r\n\r\nSFE_BMP180 pressure;\r\n\r\nchar status;\r\ndouble T,P,temp,paH,paM, tempHighest = 0.00, tempLowest = 100.00;\r\n\r\nfloat humHighest = 0.00, humTemp = 0.00, humMin = 100.00;\r\n\r\nfloat lmHighest = 0.00, lmTemp = 0.00, lmMin = 100.00;\r\n\r\nunsigned long startTimeDataCapture = 0;\r\nunsigned long lastCapture = 0;\r\n\r\nvoid setup() {\r\n\u00a0 \/\/ put your setup code here, to run once: \u00a0\r\n\u00a0 inputBuffer.reserve(256); \/\/to be optimized\r\n\u00a0 \r\n\u00a0 pressure.begin();\r\n\r\n\u00a0 dht.begin();\r\n\r\n\u00a0 pinMode(A0,INPUT);\r\n\u00a0 analogReference(INTERNAL);\r\n\r\n\u00a0myDisplay.begin();\r\n\u00a0myDisplay.setRotation(4);\r\n\u00a0myDisplay.setTextSize(1);\r\n\u00a0\/\/myDisplay.setBitrate(24000000);\r\n\u00a0\/\/myDisplay.clearScreen();\r\n\u00a0myDisplay.background(0,0,0);\r\n\r\n\u00a0myDisplay.stroke(CYAN);\r\n\u00a0myDisplay.setCursor(5,40);\r\n\u00a0myDisplay.print(\"Cur :\");\r\n\u00a0myDisplay.setCursor(5,50);\r\n\u00a0myDisplay.print(\"Min :\");\r\n\u00a0myDisplay.setCursor(5,60);\r\n\u00a0myDisplay.print(\"Max :\");\r\n\r\n\u00a0myDisplay.stroke(YELLOW);\r\n\u00a0myDisplay.setCursor(5,75);\r\n\u00a0myDisplay.print(\"Hum :\");\r\n\u00a0myDisplay.setCursor(5,85);\r\n\u00a0myDisplay.print(\"Min :\");\r\n\u00a0myDisplay.setCursor(5,95);\r\n\u00a0myDisplay.print(\"Max :\");\r\n\r\n\u00a0myDisplay.stroke(WHITE); \r\n\u00a0myDisplay.setCursor(5,110);\r\n\u00a0myDisplay.print(\"PAH :\");\r\n\u00a0myDisplay.setCursor(5,120);\r\n\u00a0myDisplay.print(\"PAM :\");\r\n\r\n\u00a0myDisplay.stroke(GREEN); \r\n\u00a0myDisplay.setCursor(5,135);\r\n\u00a0myDisplay.print(\"L_C :\");\r\n\u00a0myDisplay.setCursor(5,145);\r\n\u00a0myDisplay.print(\"L_M :\");\r\n\u00a0 \r\n\u00a0 Serial.begin(9600);\r\n\r\n\u00a0 esp8266.begin(115200);\r\n\u00a0 esp8266.println(\"AT\");\u00a0 delay(100);\r\n\u00a0 esp8266.println(\"AT+UART_CUR=4800,8,1,0,0\"); esp8266.flush(); delay(100);\r\n\u00a0 while(esp8266.available())\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Serial.write(esp8266.read());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 delay(80);\r\n\u00a0 }\r\n\u00a0 esp8266.end();\r\n\r\n\u00a0 esp8266.begin(4800);\r\n\u00a0 esp8266.println(\"AT\"); delay(100);\r\n\u00a0 \r\n\u00a0 esp8266.println(\"AT+CIPMUX=1\"); delay(100);\r\n\u00a0 esp8266.println(\"AT+CWMODE=1\"); delay(100);\r\n\u00a0 \/\/esp8266.println(\"AT+CWJAP=\"xxxxxxxxxxxxx\",\"xxxxxxxxxxxxx\"\"); esp8266.flush(); delay(1000); \u00a0\r\n\u00a0 \/\/esp8266.println(\"AT+CWJAP=\"xxxxxxxxxxxxxxxx\",\"xxxxxxxxxxxxxx\"\"); esp8266.flush();\u00a0 delay(1000); \u00a0\r\n\u00a0 \r\n\u00a0 while(esp8266.available())\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Serial.write(esp8266.read());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 delay(80);\r\n\u00a0 }\r\n\u00a0\u00a0 \u00a0\r\n\u00a0 delay(1000);\r\n}\r\n\r\n\r\n\r\nvoid loop() {\r\n\r\n\u00a0 \/\/myDisplay.setCursor(0,40);\r\n\u00a0 \r\n\u00a0 while(esp8266.available())\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Serial.write(esp8266.read());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 delay(10);\r\n\u00a0 }\r\n\r\n\u00a0 inputBuffer = \"\";\r\n\u00a0 stringComplete = false;\r\n\u00a0 \r\n\u00a0 status = pressure.startTemperature();\r\n\u00a0 if (status != 0)\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0 \/\/ Wait for the measurement to complete:\r\n\u00a0\u00a0\u00a0 delay(status);\r\n\r\n\u00a0\u00a0\u00a0 \/\/ Retrieve the completed temperature measurement:\r\n\u00a0\u00a0\u00a0 \/\/ Note that the measurement is stored in the variable T.\r\n\u00a0\u00a0\u00a0 \/\/ Function returns 1 if successful, 0 if failure.\r\n\r\n\u00a0\u00a0\u00a0 status = pressure.getTemperature(T);\r\n\u00a0\u00a0\u00a0 if (status != 0)\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Print out the measurement:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 temp = T;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Start a pressure measurement:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ The parameter is the oversampling setting, from 0 to 3 (highest res, longest wait).\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ If request is successful, the number of ms to wait is returned.\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ If request is unsuccessful, 0 is returned.\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 status = pressure.startPressure(3);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if (status != 0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Wait for the measurement to complete:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay(status);\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Retrieve the completed pressure measurement:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Note that the measurement is stored in the variable P.\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Note also that the function requires the previous temperature measurement (T).\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ (If temperature is stable, you can do one temperature measurement for a number of pressure measurements.)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Function returns 1 if successful, 0 if failure.\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status = pressure.getPressure(P,T);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (status != 0)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ Print out the measurement:\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paM = P;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paH = P*0.0295333727;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paM = -1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paH = -1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 else\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paM = -1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 paH = -1;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 else\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 temp = -1;\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 }\r\n\u00a0 else\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0 temp = -1;\r\n\u00a0 }\r\n\r\n\u00a0 if(tempLowest &gt; temp)\r\n\u00a0\u00a0\u00a0 tempLowest = temp;\r\n\r\n\u00a0 if(tempHighest &lt; temp)\r\n\u00a0\u00a0\u00a0 tempHighest = temp;\r\n\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,40,75,10);\r\n\u00a0 myDisplay.setCursor(45,40);\r\n\u00a0 myDisplay.stroke(CYAN);\r\n\u00a0 myDisplay.println(String(temp) + (char)248 +\"C\");\r\n\u00a0 \/\/delay(100);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,50,75,10);\r\n\u00a0 myDisplay.setCursor(45,50);\r\n\u00a0 myDisplay.stroke(CYAN);\r\n\u00a0 myDisplay.println(String(tempLowest) + (char)248 +\"C\");\r\n\u00a0 \/\/delay(100);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,60,75,10);\r\n\u00a0 myDisplay.setCursor(45,60);\r\n\u00a0 myDisplay.stroke(CYAN);\r\n\u00a0 myDisplay.println(String(tempHighest) + (char)248 +\"C\");\r\n\r\n\u00a0 delay(500);\r\n\r\n\u00a0 humTemp = dht.readHumidity();\r\n\u00a0 if(humHighest &lt; humTemp)\r\n\u00a0\u00a0\u00a0 humHighest = humTemp;\r\n\u00a0 if(humMin &gt; humTemp)\r\n\u00a0\u00a0\u00a0 humMin = humTemp; \u00a0\r\n\u00a0 sTemp = String(humTemp) + \"%\u00a0 \" + dht.readTemperature();\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,75,80,10);\r\n\u00a0 myDisplay.setCursor(45,75);\r\n\u00a0 myDisplay.stroke(YELLOW);\r\n\u00a0 myDisplay.println(sTemp);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,85,80,10);\r\n\u00a0 myDisplay.stroke(YELLOW);\r\n\u00a0 myDisplay.setCursor(45,85);\r\n\u00a0 myDisplay.println(humMin);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,95,80,10);\r\n\u00a0 myDisplay.stroke(YELLOW);\r\n\u00a0 myDisplay.setCursor(45,95);\r\n\u00a0 myDisplay.println(humHighest);\r\n\r\n\u00a0 delay(500);\r\n\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,110,75,10);\r\n\u00a0 myDisplay.stroke(WHITE);\r\n\u00a0 myDisplay.setCursor(45,110);\r\n\u00a0 myDisplay.println(String(paH));\r\n\u00a0 \/\/delay(500);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,120,75,10);\r\n\u00a0 myDisplay.stroke(WHITE);\r\n\u00a0 myDisplay.setCursor(45,120);\r\n\u00a0 myDisplay.println(String(paM));\r\n\r\n\u00a0 \r\n\u00a0 lmTemp=analogRead(A0); \/\/ reads the sensor output\r\n\u00a0 lmTemp=lmTemp*0.10546875;\r\n\u00a0 \/\/ converts the sensor reading to temperature\r\n\u00a0 if(lmHighest &lt; lmTemp)\r\n\u00a0\u00a0\u00a0 lmHighest = lmTemp;\r\n\u00a0 if(lmMin &gt; lmTemp)\r\n\u00a0\u00a0\u00a0 lmMin = lmTemp; \u00a0\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,135,75,10);\r\n\u00a0 myDisplay.stroke(GREEN);\r\n\u00a0 myDisplay.setCursor(45,135);\r\n\u00a0 myDisplay.println(String(lmTemp));\r\n\u00a0 \/\/delay(500);\r\n\u00a0 myDisplay.fill(BLACK);\r\n\u00a0 myDisplay.stroke(BLACK);\r\n\u00a0 myDisplay.rect(45,145,75,10);\r\n\u00a0 myDisplay.stroke(GREEN);\r\n\u00a0 myDisplay.setCursor(45,145);\r\n\u00a0 myDisplay.println(String(lmMin));\r\n\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\r\n\u00a0 if(millis() - lastCapture &gt;\u00a0 300000)\r\n\u00a0 {\r\n\u00a0\u00a0\u00a0 lastCapture = millis();\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 esp8266.println(\"AT+CWJAP=\"xxxxxxxxxxxxxxxx\",\"xxxxxxxxxxxxxxxxxx\"\"); esp8266.flush();\u00a0 delay(5000);\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 data1 = \"GET \/interface_1.php?action=1&amp;temp=\"+String(temp)+\"&amp;paM=\"+String(paM)+\"&amp;paH=\"+String(paH)+\" HTTP\/1.1\";\r\n\u00a0\u00a0\u00a0 data2 = \"Host: 128.199.183.127\";\r\n\u00a0\u00a0\u00a0 data3 = \"User-Agent: IOT\";\r\n\u00a0\u00a0\u00a0 data5 = \"Connection: close\";\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 Serial.println(data1);\r\n\u00a0\u00a0\u00a0 \/\/Serial.println(data1.length()+data2.length()+data3.length()+data4.length()+data5.length());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 esp8266.println(\"AT+CIPSTART=4,\"TCP\",\"xxx.xxx.xxx.xxx\",nn\");\u00a0 delay(1000); \r\n\u00a0\u00a0\u00a0 while(esp8266.available())\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Serial.write(esp8266.read());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay(10);\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0 \r\n\u00a0\u00a0\u00a0 slength = String(data1.length()+data2.length()+data3.length()+data5.length()+12);\r\n\u00a0\u00a0\u00a0 esp8266.println(\"AT+CIPSEND=4,\"+slength);\r\n\u00a0\u00a0\u00a0 delay(1000);\r\n\u00a0\u00a0\u00a0 while(esp8266.available())\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/Serial.write(esp8266.read());\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay(10);\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0 \/\/ put your main code here, to run repeatedly:\r\n\u00a0\u00a0\u00a0 esp8266.println(data1); delay(1);\r\n\u00a0\u00a0\u00a0 esp8266.println(data2); delay(1);\r\n\u00a0\u00a0\u00a0 esp8266.println(data3); delay(1);\r\n\u00a0\u00a0\u00a0 esp8266.println(data5); delay(1);\r\n\u00a0\u00a0\u00a0 esp8266.println();\u00a0 delay(1); esp8266.flush();\r\n\u00a0 \r\n\u00a0\u00a0\u00a0 while(1)\r\n\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if(esp8266.available())\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 inputBuffer += (char)esp8266.read();\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 if(inputBuffer.indexOf(\"CLOSED\")&gt; 0 || millis() - startTimeDataCapture &gt; 10000) \/\/don't wait more than 20 seconds\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 stringComplete = true;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Serial.println(inputBuffer);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 delay(1);\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 break;\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 }\r\n\u00a0\u00a0\u00a0 esp8266.println(\"AT+CIPCLOSE=4\");\r\n\u00a0\u00a0\u00a0 delay(10);\r\n\u00a0\u00a0\u00a0 esp8266.println(\"AT+CWQAP\");\r\n\u00a0 }\r\n\u00a0 \r\n\u00a0 delay(1000);\r\n\u00a0 \r\n\u00a0 \r\n}<\/pre>\n<p><em>An Arduino Pro Mini running at 3.3v will be suitable for this. There will be no need of the logic level converters.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently purchased a cheap color LCD from Ebay (http:\/\/www.ebay.com\/itm\/1-44-Red-Serial-128X128-SPI-Color-TFT-LCD-Module-Display-Replace-Nokia-5110-LCD-\/310876068105?hash=item4861a85909:g:9LoAAOSwpzdWqdY~). They are really good for displaying anything (from an Arduino perspective) in color. Though the are cheap and nice, but finding the proper library for them can be a pain. It would be wise to check the details of the LCD and availability of it&#8217;s library&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/arduino\/using-a-1-44-color-lcd-with-arduino-as-a-display\/\">Continue reading <span class=\"screen-reader-text\">Using a 1.44&#8243; Color LCD with Arduino as a display<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[76,13,75],"class_list":["post-474","post","type-post","status-publish","format-standard","hentry","category-arduino","tag-1-44-lcd","tag-arduino","tag-color-lcd","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/474","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=474"}],"version-history":[{"count":1,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/474\/revisions"}],"predecessor-version":[{"id":475,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/474\/revisions\/475"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=474"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=474"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=474"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}