-->
Page 1 of 2

I2C comunicaton

PostPosted: Wed May 10, 2017 7:37 am
by Dalibor
Hello all
I'm a beginner, and tehnical enthusiast, please have understanding for my stupid questions.
I have am2300 sensor and traying to comunicate whit my esp8266 using basic.
As I understand it, i should use I2c protocol?
I did not get far the following example on site...:/ I finde i2c adress for my sensor, its 92.
My code look something like this
Code: Select alllet address = 92
let numchars = 1
i2c.begin(address)
i2c.write(1)
i2c.available()
i2c.end()
i2c.requestfrom(address,numchars)
delay 50
temp= i2c.read()
print temp

Can you point me in the right direction?

Re: I2C comunicaton

PostPosted: Thu May 11, 2017 3:50 am
by neuronesp
No.
The component that you refer is a mosfet (output device) that is controlled with a simple high or low signal.
Not a sensor (input device)
See examples.
Read and learn as much as you can.
I am still trying to get my head around I2C.

Re: I2C comunicaton

PostPosted: Thu May 11, 2017 2:48 pm
by trackerj
2c TIP for everybody : As a good practice, please post also a link to the datasheet or schematics of the device that you are asking for. Best way to avoid confusions and waste of time.

Re: I2C comunicaton

PostPosted: Sun May 14, 2017 4:24 pm
by Dalibor
I will go the path of least resistance this time and buy DTH sensor. Its too complicated for me, i need more to learn. As I understand it Am2320 use more then one Bit of code to get information. Looking in arduino libraries its 0x03, 0x00, 0x04.. but i cant implement that in esp basic. I will get a simpler device so i can to practice I2C comunication.