Hello,
I'm trying to use the I2C sample code in IoT demo in the Non OS SDK to interface with HTU21D temperature and humidity sensor, however it does not seem to work i.e. the slave does not give me an ACK at all, how the same sensor work nicely when I flash Arduino software for ESP8266. The logic analyzer also shows that the slave is not giving me an acknowledgement. I have also taken care to see the hardware is proper and connections are alright.
This the code i have added in the user_init function
i2c_master_gpio_init();
//delay for 5ms
os_delay_us(5000);
i2c_master_start();
i2c_master_writeByte(0x80);
ack = i2c_master_checkAck();
if(ack)
os_printf("\r\n ack \r\n");
i2c_master_writeByte(0xFE);
ack = i2c_master_checkAck();
if(ack)
os_printf("\r\n ack \r\n");
i2c_master_stop();
I2C sample code in IoT demo not working with HTU21D
-
- Posts: 1
- Joined: Thu Feb 04, 2016 10:53 am
I2C sample code in IoT demo not working with HTU21D
Postby Vishwa_125 » Thu Feb 04, 2016 11:02 am
Who is online
Users browsing this forum: No registered users and 17 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.