Hi,
quite an average noob but learns quick..ish!! I have this code for a Web Weather Server however it only outputs to the Internet which is great however as a portable web weather station it would be really cool if it also displayed 4 lines of the output (which can be commented out to select the wanted) however I have used a previous version of the code and successfully integrated an LCD with Humidity and Temperature on the output to a 16x2 LCD but this code uses SPI and that is already allocated to a BMP280 temp,humidity,barometer sensor and when I run my failed code the 20x4 screen just has 2 lines of blocks and code fails as it seems there is a problem with the 2 items being on the same SPI pins. OK I worked out they need separate addresses and that's OK but only works if I either disconnect the display or BMP280. With the new code I have stopped short of even trying to program it or write in the code as I fear I am going to just run into a brick wall.
Please anyone with help on how to integrate a SPI 20x4 display YwRobot into the following code would be really appreciated.
Lastly I am not here asking some to re-write the code but I have spent hours on it and contributions welcomed so everyone can enjoy the code and have the weather station in their homes. I think it wouldalso benefit from some serial.print code so people could see it working without the network too?
Many thanks kind regards
Spence
PS: you would have to input your own IP and forwarded port as well as SSID if you want it to work obviously.
Probably both devices have the same i2c address.
Run the i2c scanner (available on arduino.cc) to check the address of each board.
Most i2c devices have a way to change it's addr, normally they have a choice of at least 2 addrs.
You'll have to check the documentation of your particular device to learn how to change the addr.
If the BME device is using i2c, the i2c address from the datasheet is 0x76 or 0x77, which is different from the i2c address ranges used by PCF8574 chips used on LCD backpacks.
The code you posted doesn't have any lcd code in it.
If you are looking for recommendations for an lcd library to run an LCD that uses a PCF8574 backpack to convert it to i2c, then I'd recommend using my hd44780 library.
It will auto detect the i2c address of the backpack, and the pin mappings used on the backpack.
It also includes a diagnostic sketch to test the i2c signals, does a i2c bus scan for devices and tests the internal RAM of the LCD.
It can be installed using the IDE library manager.
You can read more about it here: GitHub - duinoWitchery/hd44780: Extensible hd44780 LCD library
The i/o class for i2c backpacks is hd44780_I2Cexp and the diag sketch is I2CexpDiag
As you move your output messages from the serial port to the LCD, keep in mind that the LCD does not support line endings so println() cannot be used and there will be no wrapping or scrolling so you must position the cursor before sending your text to the display.