I2C and ESP8266 / nodemcu

Interfacing to the codebug
Post Reply
mikerr
Posts: 83
Joined: Fri Jul 31, 2015 10:37 am
Contact:

I2C and ESP8266 / nodemcu

Post by mikerr » Fri Oct 30, 2015 4:41 pm

I've just received an esp8266/nodemcu board
-great value mcu with wifi for under a fiver : ryantek.uk or china:banggood.com

so I made a start on a LUA version of I2C comms with the codebug:

Code: Select all

id=0
sda=1
scl=2
CODEBUG=0x18
SET=3
LED_LINE=1

i2c.setup(id,sda,scl,i2c.SLOW)
i2c.start(id)
i2c.address(id,CODEBUG,i2c.TRANSMITTER)
i2c.write(id,SET)
i2c.write(id,LED_LINE)
i2c.write(id,15)
-- 15 = 01111 in binary - lighting up those 4 LEDS

Success !

Image

Stuff on github as usual:

http://github.com/mikerr/nodecodebug
Twitter @mikered codebug profile mikerr

Post Reply