ESP + Arduino like a extender (i2c)

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
spalex
New user
Posts: 1
Joined: 02 Dec 2018, 23:13

ESP + Arduino like a extender (i2c)

#1 Post by spalex » 02 Dec 2018, 23:25

Hi! I want to connect ESP (ESP EASY) with my Arduino by i2c wire.
Now the task is simple, send an command from ESP EASY like this:
http://ip/control?cmd=pcfgpio,4,1
and catch an Wire.onReceive event on Arduino and get data

Code: Select all

 
#include <Wire.h>
 
void setup()
{
  Wire.begin(4);                
  Wire.onReceive(receiveEvent); 
  Serial.begin(9600);          
  Serial.println("Start slave");
}
 
void loop()
{
  ......
}
 
void receiveEvent(int howMany)
{
  Serial.print("EVENT!");
  c = Wire.read();
  ....
}
l2c scan on ESP EASY is working!
i2c connect ESP 8285 (Master) -> Arduino (Slave) is working!

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests