diff --git a/ESP8266/I2C/.gitignore b/ESP8266/I2C/.gitignore new file mode 100755 index 0000000..89cc49c --- /dev/null +++ b/ESP8266/I2C/.gitignore @@ -0,0 +1,5 @@ +.pio +.vscode/.browse.c_cpp.db* +.vscode/c_cpp_properties.json +.vscode/launch.json +.vscode/ipch diff --git a/ESP8266/I2C/platformio.ini b/ESP8266/I2C/platformio.ini new file mode 100755 index 0000000..10a1dbc --- /dev/null +++ b/ESP8266/I2C/platformio.ini @@ -0,0 +1,16 @@ +;PlatformIO Project Configuration File +; +; Build options: build flags, source filter +; Upload options: custom upload port, speed and extra flags +; Library options: dependencies, extra library storages +; Advanced options: extra scripting +; +; Please visit documentation for the other options and examples +; https://docs.platformio.org/page/projectconf.html + +[env:nodemcuv2] +platform = espressif8266 +board = nodemcuv2 +framework = arduino +monitor_speed = 115200 +upload_speed = 256000 \ No newline at end of file diff --git a/ESP8266/I2C/src/main.cpp b/ESP8266/I2C/src/main.cpp new file mode 100755 index 0000000..a226bdc --- /dev/null +++ b/ESP8266/I2C/src/main.cpp @@ -0,0 +1,38 @@ +#include +#include + +void setup() +{ + + pinMode(D0, OUTPUT); + Serial.begin(115200); + Wire.begin(D2, D1); /* I2C bus SDA=D2 and SCL=D1 */ +} + +void loop() +{ + byte error, address; + int nDevices; + + Serial.println("Escaneando..."); + Serial.println("**************"); + + nDevices = 0; + for (address = 1; address < 127; address++) + { + + Wire.beginTransmission(address); + error = Wire.endTransmission(); + + if (error == 0) + { + Serial.print("Encontrado dispositivo I2C dirección 0x"); + if (address < 16) + Serial.print("0"); + Serial.println(address, HEX); + nDevices++; + } + } + Serial.println("**************"); + delay(2000); +} diff --git a/PICO/README.md b/PICO/README.md index 3e6deda..50e81d9 100644 --- a/PICO/README.md +++ b/PICO/README.md @@ -5,7 +5,7 @@ + RASPBERRY PI PICO ### PinOUT PICO -![pinmap](Raspberry-Pi-Pico-pinout-diagram.svg) +![pinmap](Raspberry-Pi-Pico-pinout-diagram.png) ### Data -![SDK](data/PICO_C_SDK.pdf) +[SDK](data/PICO_C_SDK.pdf) diff --git a/PICO/Raspberry-Pi-Pico-pinout-diagram.png b/PICO/Raspberry-Pi-Pico-pinout-diagram.png new file mode 100644 index 0000000..2819660 Binary files /dev/null and b/PICO/Raspberry-Pi-Pico-pinout-diagram.png differ