Tell me what you want, What you really, really want.

Moderator: Mmiscool

User avatar
By sadat007
#37863 1. Humidity Temperature modules HTU21, SHT21
2. Real Time Clock. DS1307, DS3231
3. Variable storage in I2C EEPROMS 24xx
4. I2C I/O PCF8574
5. SD Card FAT32
6. In future also like libs for gyros, accelerometer , compass.... MPU-6050, HMC5883L, BMP180
7. SPI

This is too much but first twos are very urgent required.
Thanks for great work.
User avatar
By Mmiscool
#37917 I2c is implemented and can be used i the interpreter.

I might be inclined to add native commands for HTU21 but don't currently have any to test with so will need to wait on shipping from china on these if I order some.


Some one already wrote the basic code to interface with one of the i2c clock modules.
http://www.esp8266basic.com/i2c-reading ... clock.html


SD card support is not planed as the esp devices have lots of built in flash for long term storage of data elements. See the following.
http://www.esp8266basic.com/file-io.html
User avatar
By Mmiscool
#39026 I did order one of this tempature humidity moduels and am waiting for it to get in. Been rather busy lately. My town is getting its first maker space and I have been spending a lot of time working on getting things set up for that. The world is changing so much and I am really glad that this kind of technology is available for so cheap. Stay tuned. I hope to get working on that as soon as I receive them from china.
User avatar
By luc VdV
#39038 just to get you started:
I2CROM (i tested it with the 24C512)
The example uses addr 0 (16xadr_hi + adr_lo) to write/read the value of databyte
The I2C_adr depends on your hardware. if you tie A0,A1, A2of the mem-chip to ground the address is 80
Code: Select allprint "Created with ESP Basic 1.76"
let I2C_adr = 80
let databyte = 170
let adr_hi = 0
let adr_lo = 0
button "write" [I2C_write]
button "read" [I2C_read]
button "exit" [Exit]
wait
[Exit]
print "end"
end
[I2C_write]
i2c.begin(I2C_adr)
i2c.write(adr_hi)
i2c.write(adr_lo)
i2c.write(databyte)
i2c.end()
wait
[I2C_read]
i2c.begin(I2C_adr)
i2c.write(adr_hi)
i2c.write(adr_lo)
i2c.end()
i2c.requestfrom(I2C_adr,1)
x = i2c.read()
i2c.end()
print x
wait


[img]24C512.png[/img]

To use a RTC like the DS1307 the code is nearly the same. It uses 8bit address so no need to use adr_hi. Change the I2C_adr to 104.

Reading the SHT21 is something completely different as it is not 1-wire compatible.
You do not have the required permissions to view the files attached to this post.