Dynamo wrote:I am planning to use the ESP8266 ESP-12E.
I want to suggest you start with a development board, like
a NodeMCU, first before trying to get a bare module working, especially when your new.
Once you got the hardware and software working as intended, you can opt to design your own schematics and PCB using any of the available ESP modules.
Dynamo wrote:I would like to know your opinion if there could be problems using the encoder and the gy-521 , as the encoder will make a lot of interference when rotating, right?
I've only played with an encoder once (I personally only use normal buttons), but getting it working properly can be tricky: in my experience using an interrupt would be the most reliable option, but I believe there are a couple of topics on the forum that deal with this subject.
Depending on the type of project you have to consider using either hardware or software
de-bouncing though, because with either (encoder of normal switches) you will get bounced.
Talking I2C is easy: just include the Wire-library, set the GPIO's the device(s) is/are connected to and talk.
To check the existence/address of (each) I2C device on the bus you can use an I2C scanner sketch like below:
Code: Select all#include "Wire.h"
void setup(){
Serial.begin(115200);
while(!Serial){} // Waiting for serial connection
Serial.println();
Serial.println("Start I2C scanner ...");
Serial.print("\r\n");
byte count = 0;
Wire.begin();
for (byte i = 8; i < 120; i++)
{
Wire.beginTransmission(i);
if (Wire.endTransmission() == 0)
{
Serial.print("Found I2C Device: ");
Serial.print(" (0x");
Serial.print(i, HEX);
Serial.println(")");
count++;
delay(1);
}
}
Serial.print("\r\n");
Serial.println("Finish I2C scanner");
Serial.print("Found ");
Serial.print(count, HEX);
Serial.println(" Device(s).");
}
void loop() {}