I am using a NodeMCU 0.9 and a BMP280 from Ebay. It has 6 connections, in the following order:
VCC - 3.3v voltage
GND - ground
SCL - clock, I assume
SDA - data, I assume, but not sure if in or out
CSB - chip select, I assume
SDO - data out, I think? Not sure.
In terms of hookup, I have voltage and ground hooked up to 3.3v and ground, and then have SCL plugged into GPIO14 (d5) and SDA plugged into GPIO12 (d6). SDO is plugged into GPIO13 (d7) but the code behaves the same regardless of this is plugged in or not. If CS is plugged into GPIO15 (d8) the board fails to boot.
I'm trying to use the BME280 library on the floating point firmware flashed to my board. (found here: https://nodemcu.readthedocs.io/en/maste ... es/bme280/) and the build is below:
modules: adc,bit,bme280,dht,encoder,file,gpio,http,i2c,mdns,mqtt,net,node,pcm,pwm,rtcmem,rtctime,sntp,spi,struct,tmr,u8g,uart,wifi,ws2801,ws2812
build built on: 2016-09-15 04:08
powered by Lua 5.1.4 on SDK 1.5.4.1(39cb9a32)
I call bme280.init(6,5) which takes the pin for SDA and SCL. I then print the result of the initialization which returns 1, meaning a BMP280 was initialized successfully.
However, any time I try to get data, regardless of the function, it always returns nil. The documentation says this nil is returned when the readout is not successful.
1. Do I have my wiring set up correctly?
2. Is the code faulty? Should I try the dev branch or am I missing a package or something?
Below is the Ebay link to the BMP280 I purchased and linked is a picture of the backside, showing the pinout
http://www.ebay.com/itm/141975980328?_t ... EBIDX%3AIT
http://imgur.com/a/bh9Xa
Looking for any help people can provide! Thanks in advance!