fritzing sketch, added more info to readme master
fritzing sketch, added more info to readme

file:a/func.lua -> file:b/func.lua
--- a/func.lua
+++ b/func.lua
@@ -2,14 +2,14 @@
 
 -- setup SPI and connect display
 function init_spi_display()
-   -- Hardware SPI CLK  = GPIO14
-   -- Hardware SPI MOSI = GPIO13
-   -- Hardware SPI MISO = GPIO12 (not used)
-   -- Hardware SPI /CS  = GPIO15 (not used)
+   -- Hardware SPI CLK  = D5 / GPIO14
+   -- Hardware SPI MOSI = D7 / GPIO13
+   -- Hardware SPI MISO = D6 / GPIO12 (not used)
+   -- Hardware SPI /CS  = D8 / GPIO15 (not used)
    -- CS, D/C, and RES can be assigned freely to available GPIOs
-   local cs  = 8 -- GPIO15, pull-down 10k to GND
-   local dc  = 4 -- GPIO2
-   local res = 0 -- GPIO16
+   local cs  = 8 -- D8 / GPIO15, pull-down 10k to GND
+   local dc  = 4 -- D4 / GPIO2
+   local res = 0 -- D0 / GPIO16
 
    spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 8, 8)
    -- we won't be using the HSPI /CS line, so disable it again
@@ -108,12 +108,12 @@
     if P and T then
         sData.baro_qfe = string.format("%d.%03d", P/1000, P%1000)
         if serialDebug then print("QFE=" .. sData.baro_qfe) end
+        printText(sData.baro_qfe, 18, 170, 150)
 
         -- convert measure air pressure to sea level pressure
         QNH = bme280.qfe2qnh(P, altitude)
         sData.baro_qnh = string.format("%d.%03d", QNH/1000, QNH%1000)
         if serialDebug then print("QNH=" .. sData.baro_qnh) end
-        printText(sData.baro_qnh, 18, 170, 150)
     end
         -- altimeter function - calculate altitude based on current sea level pressure (QNH) and measure pressure
     P = bme280.baro()

 Binary files /dev/null and b/info/nodemcu v2 amica.png differ
file:b/info/sketch.fzz (new)
 Binary files /dev/null and b/info/sketch.fzz differ
 Binary files a/info/wifiweatherstation.jpg and /dev/null differ
 Binary files /dev/null and b/info/wifiweatherstation.png differ
file:a/readme.md -> file:b/readme.md
--- a/readme.md
+++ b/readme.md
@@ -1,8 +1,8 @@
-# NodeMCU/BME280 Weather station
+# NodeMCU/BME280/320x240 TFT Weather station
 
 ## Features
 * integrated with IoTCC using mqtt
-* display on SPI TFT LCD
+* display on SPI TFT LCD (ILI9341)
 * NTP time sync
 * debug on serial and LCD
 
@@ -16,15 +16,24 @@
 disp = ucg.ili9341_18x240x320_hw_spi(cs, dc, res)
 ```
 
-Connect it to NodeMCU
-* Hardware SPI CLK  = GPIO14
-* Hardware SPI MOSI = GPIO13
-* Hardware SPI MISO = GPIO12 (not used)
-* Hardware SPI /CS  = GPIO15 (not used)
+Connect TFT to NodeMCU
+* Hardware SPI CLK  -> D5 / GPIO14
+* Hardware SPI MOSI -> D7 / GPIO13
+* Hardware SPI MISO -> D6 / GPIO12 (not used)
+* Hardware SPI /CS  -> D8 / GPIO15 (not used)
 * CS, D/C, and RES can be assigned freely to available GPIOs
-* local cs  = 8 -- GPIO15, pull-down 10k to GND
-* local dc  = 4 -- GPIO2
-* local res = 0 -- GPIO16
+* cs                -> D8 / GPIO15, pull-down 10k to GND
+* dc                -> D4 / GPIO2
+* res               -> D0 / GPIO16
+* LED               -> 3.3v
+* VCC               -> 3.3v
+* GND               -> GND
+
+Connect BME280 to NodeMCU
+* SDA  -> D2 / GPIO4
+* SCL  -> D1 / GPIO5
+* 3.3v -> 3.3v
+* GND  -> GND
 
 ## NodeMCU modules required
 * bit

comments