|     Inicio    |   |         |  |   FOROS      |  |      |      
   Elastix - VoIP B4A (Basic4Android) App inventor 2 PHP - MySQL
  Estación meteorológica B4J (Basic4Java) ADB Shell - Android Arduino
  Raspberry Pi Visual Basic Script (VBS) FireBase (BD autoactualizable) NodeMCU como Arduino
  AutoIt (Programación) Visual Basic Cosas de Windows Webs interesantes
Translate:
Búsqueda en este sitio:


.

Arduino en español
Circuitos con Arduino - Juan Antonio Villalpando

-- Tutorial de iniciación a Arduino --

Volver al índice del tutorial                    Return to index tutorial

____________________________

57_4.- Módulo Wifi ESP8266 ESP-01.

1.- Servidor Web. Control de un LED por Wifi. Módulo ESP8266 trabajando sin Arduino. Standalone.

- Vamos a encender/apagar un LED mediante el ESP8266 funcionando independientemente, sin Arduino. El LED lo controlaremos escribiendo una dirección web local.
Utilizaremos el Arduino UNO para cargar el programa en el ESP8366. Luego lo desconectaremos del Arduino.

- Hay varias acciones que repetirá varias veces, cargar el Bareminimun, quitar y poner la alimentación del módulo para que se reinicie, la velocidad del Serial Monitor de 9600, poner y quitar el GPIO 0, cambiar en el IDE / Herramientas para el Arduino UNO y para Generic ESP8266,...

1.- Ponemos el IDE Arduino en Herramientas / Placa: Arduino UNO

2.- Cargamos en el Arduino el programa BareMinimun.

Archivos / Ejemplos / 01.Basics / BareMinimum

3.- Conectamos el ESP8266 y lo ponemos en modo firmware con el GPIO 0 a GND.

4.- Bajamos el programa ESP8266_flasher.zip y cargamos el v0.9.2.4 AT Firmware-ESPFIX.bin, como lo hemos realizado en los tutoriales anteriores.

5.- Ponemos el IDE Arduino en Herramientas / Placa: Generic ESP8266 Module.

[También me funcionó estableciendo la placa: Nodemcu 0.9 ESP (12 Module)]

 

6.- Quita el Monitor Serie, en caso que lo tengas abierto.

7.- Cargamos este programa en el IDE y los subimos...

Conviene de vez en cuando quitar la alimentación del ESP8266 y volverla a poner si es que no carga bien.

8.- Cuando haya subido, quita el cable GPIO 0 a GND y abre el Monitor Serie. Reinicia.

9.- Una vez cargado el programa podemos quitar el Arduino, conectar un LED al GPIO2 y alimentar al módulo con 3,3V

- Si no tienes fuente de alimentación de 3,3 V, puedes utilizar el Arduino para alimentar al módulo, observa que no necesitas RX ni TX.

10.- Vamos a un navegador web y escribimos:

http://192.168.1.11/gpio/1

http://192.168.1.11/gpio/0

 

ESP01_StandAlone_1.ino
/*
 *  This sketch demonstrates how to set up a simple HTTP-like server.
 *  The server will set a GPIO pin depending on the request
 *    http://server_ip/gpio/0 will set the GPIO2 low,
 *    http://server_ip/gpio/1 will set the GPIO2 high
 *  server_ip is the IP address of the ESP8266 module, will be 
 *  printed to Serial when the module is connected.
 */

#include <ESP8266WiFi.h>

const char* ssid = "nombredemirouter";
const char* password = "contraseñadelrouter";

// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);

void setup() {
Serial.begin(9600);
delay(1500);

// prepare GPIO2
pinMode(2, OUTPUT);
digitalWrite(2, LOW);

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

// Start the server
server.begin();
Serial.println("Server started");

// Print the IP address
Serial.println(WiFi.localIP());
}

void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}

// Wait until the client sends some data
Serial.println("new client");
while(!client.available()){
delay(1);
}

// Read the first line of the request
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();

// Match the request
int val;
if (req.indexOf("/gpio/0") != -1)
val = 0;
else if (req.indexOf("/gpio/1") != -1)
val = 1;
else {
Serial.println("invalid request");
client.stop();
return;
}

// Set GPIO2 according to the request
digitalWrite(2, val);

client.flush();

// Prepare the response
String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nGPIO is now ";
s += (val)?"high":"low";
s += "</html>\n";

// Send the response to the client
client.print(s);
delay(1);
Serial.println("Client disonnected");

// The client will actually be disconnected 
// when the function returns and 'client' object is detroyed
}

      

https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/examples/WiFiManualWebServer/WiFiManualWebServer.ino

- IMPORTANTE para que cargue la aplicación ponemos una resistencia de unos 20k (no es necesario) entre GPIO0 y GND.

Código_2
// Juan A. Villalpando
// ESP8266-01

#include <ESP8266WiFi.h>

const char* ssid = "nombredemirouter";
const char* password = "contraseñadelrouter";

WiFiServer server(80);

void setup() {
Serial.begin(9600);
delay(100);

pinMode(2, OUTPUT); // GPIO2

// Conexión a Wifi
Serial.println();
Serial.print("Conectando con ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("Conectado a Wifi.");

// Inicio del Servidor Web
server.begin();
Serial.println("Server iniciado.");

// Muestra la IP.
Serial.println(WiFi.localIP());
}

void loop() {
// Comprueba si se ha conectado algún cliente.
WiFiClient client = server.available();
if (!client) {
return;
}

// Espera hasta que el cliente envie algún dato.
Serial.println("Nuevo cliente.");
while(!client.available()){
delay(1);
}

// Lee la primera línea de petición.
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();

// Lee y muestra información
int val;
if (req.indexOf("/0") != -1)
val = 0;
else if (req.indexOf("/1") != -1)
val = 1;
else {
Serial.println("Peticion incorrecta.");
client.stop();
return;
}

// Pone el terminal GPIO2 al valor deseado.
digitalWrite(2, val);

client.flush();

// Respuesta web
String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\n\r\nGPIO esta ahora en ";
s += (val)?"alto":"bajo";
s += "</html>\n";

// Envía la respuesta al cliente.
client.print(s);
delay(1);
Serial.println("Cliente desconectado.");

}
			
      

 

Código_3
// Juan A. Villalpando
// ESP8266-01
/ Juan A. Villalpando
// ESP8266-01

#include <ESP8266WiFi.h>

const char* ssid = "nombredemirouter";
const char* password = "contraseñadelrouter";

WiFiServer server(80);

#define LED2  2    // LED en terminal 2
String estado = "";

void setup() {
  Serial.begin(9600);
  pinMode(LED2, OUTPUT);

// Conecta a la red wifi.
  Serial.println();
  Serial.print("Conectando con ");
  Serial.println(ssid);
 
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("Conectado con WiFi.");
 
  // Inicio del Servidor web.
  server.begin();
  Serial.println("Servidor web iniciado.");
 
  // Esta es la IP
  Serial.print("Esta es la IP para conectar: ");
  Serial.print("http://");
  Serial.println(WiFi.localIP());
}
 
void loop() {
  // Consulta si se ha conectado algún cliente.
  WiFiClient client = server.available();
  if (!client) {
    return;
  }
   
  Serial.print("Nuevo cliente: ");
  Serial.println(client.remoteIP());
   
  // Espera hasta que el cliente envíe datos.
  while(!client.available()){ delay(1); }

  /////////////////////////////////////////////////////
  // Lee la información enviada por el cliente.
  String req = client.readStringUntil('\r');
  Serial.println(req);

  // Realiza la petición del cliente.
       if (req.indexOf("on2") != -1) {digitalWrite(LED2, HIGH); estado = "Encendido";}
       if (req.indexOf("off2") != -1){digitalWrite(LED2, LOW); estado = "Apagado";}

  //////////////////////////////////////////////
  // Página WEB. ////////////////////////////
  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println(""); //  Importante.
  client.println("<!DOCTYPE HTML>");
  client.println("<html>");
  client.println("<head><meta charset=utf-8></head>");
  client.println("<body><center><font face='Arial'>");
  client.println("<h1>Servidor web con ESP32.</h1>");
  client.println("<h2><font color='#009900'>KIO4.COM - Juan A. Villalpando</font></h2>");
  client.println("<h3>Página web.</h3>");
  client.println("<br><br>");
  client.println("<img src='http://juanant91.byethost3.com/kio42.png'><br>");
  client.println("<a href='on2'><button>Enciende LED2</button></a>");
  client.println("<a href='off2'><button>Apaga LED2</button></a>"); 
  client.println("<br><br>");
  client.println(estado);
  client.println("</font></center></body></html>");

  Serial.print("Cliente desconectado: ");
  Serial.println(client.remoteIP());
  client.flush();
  client.stop();
}
      

- [Puedes obtener una respuesta más rápida simplifica el código HTML, quita los textos, la imagen el button, incluso quita la cabecera.]

12.- Quitamos el cable del GPIO 0

13.- Abrimos el Serial Monitor, con velocidad 9600 y observamos la IP asignada, por ejemplo 192.168.1.7

Podemos independizar al módulo ESP8266 del Arduino.

Alimentamos del ESP8266 con alimentación externa, (o bien con el Arduino, en caso que no tengas fuente de alimentación externa. pero le quitamos TX y RX)

14.- Conectamos un LED al terminal GPIO 2 del módulo.

15.- Escribimos esto en un navegador:

http://102.168.1.7/gpio/0

http://102.168.1.7/gpio/1

Se encenderá y apagará el LED y se indicará en una página web.

2.- Sensor de temperatura con el 18B20.

A.- Seguimos con el IDE 1.6.7. Ponemos en Herramientas / Placa: Arduino UNO

- Consulta este tutorial, incluso realízalo primero indendientemente del módulo ESP8266.

- En la carpeta libraries del IDE 1.6.7 pegamos esta carpeta OneWire.zip.

- Realizamos esta conexión en el Arduino UNO.

- Una resistencia de 4k7 y conexión al Pin2 del Arduino:

- En el tutorial Sensor de temperatura con el 18B20 observamos un código, ese código está preparado para varios tipos de sensores, como en mi caso voy a utilizar el 18B20, he reducido el código...

- Abre el Serial Monitor a 9600 y verás la temperatura actual.

Código
Sensor de Temperatura 18B20 en el Arduino UNO

// Modificado por Juan A. Villalpando


#include <OneWire.h>
OneWire  ds(2);
void setup(void) {
  Serial.begin(9600);
}

void loop(void) {
byte i;
byte present = 0;
byte type_s=0;
byte data[12];
byte addr[8];
float celsius;

if ( !ds.search(addr)) {
ds.reset_search();
return;
}

ds.reset();
ds.select(addr);
ds.write(0x44, 1);

delay(2000); 

present = ds.reset();
ds.select(addr); 
ds.write(0xBE);

for ( i = 0; i < 9; i++) { data[i] = ds.read(); }

int16_t raw = (data[1] << 8) | data[0];
celsius = (float)raw / 16.0;
Serial.print(" Temperatura = ");
Serial.println(celsius);
}

Acabamos de comprobar que ese sensor funciona en el Arduino UNO con ese código.

Vamos a pasar ese código al ESP8266

B.- Seguimos con el IDE 1.6.7.

- Realizamos el mismo proceso que hemos visto al inicio de esta página desde el principio, es decir volvemos a grabar el firmware, repetir todo el proceso, lo único que vamos a cambiar es el código final de carga, este...

Código Sensor de temperatura con el 18B20 en el ESP8266
#include <ESP8266WiFi.h>
#include <OneWire.h> ////////////////////////////
OneWire ds(2); /////////////////////////////////
const char* ssid = "nombredeturouter";
const char* password = "contraseñadelrouter";



// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);

void setup() {
Serial.begin(9600);
delay(1500);



// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

// Start the server
server.begin();
Serial.println("Server started");

// Print the IP address
Serial.println(WiFi.localIP());
}

void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}

// Wait until the client sends some data
Serial.println("new client");
while(!client.available()){
delay(1);
}

// Read the first line of the request
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();


// Match the request
int val;
if (req.indexOf("/gpio/0") != -1)
val = 0;
else if (req.indexOf("/gpio/1") != -1)
val = 1;
else {
Serial.println("invalid request");
client.stop();
return;
}


////////////////////////-- INICIO DEL CÓDIGO DEL 18B20 --//////////////////////
byte i;
byte present = 0;
byte type_s;
byte data[12];
byte addr[8];
float celsius, fahrenheit;

if ( !ds.search(addr)) {
Serial.println("No more addresses.");
Serial.println();
ds.reset_search();
delay(250);
return;
}

Serial.print("ROM =");
for( i = 0; i < 8; i++) {
Serial.write(' ');
Serial.print(addr[i], HEX);
}

if (OneWire::crc8(addr, 7) != addr[7]) {
Serial.println("CRC is not valid!");
return;
}
Serial.println();

// the first ROM byte indicates which chip
switch (addr[0]) {
case 0x10:
Serial.println(" Chip = DS18S20"); // or old DS1820
type_s = 1;
break;
case 0x28:
Serial.println(" Chip = DS18B20");
type_s = 0;
break;
case 0x22:
Serial.println(" Chip = DS1822");
type_s = 0;
break;
default:
Serial.println("Device is not a DS18x20 family device.");
return;
} 

ds.reset();
ds.select(addr);
ds.write(0x44, 1); // start conversion, with parasite power on at the end

delay(2000); // maybe 750ms is enough, maybe not
// we might do a ds.depower() here, but the reset will take care of it.

present = ds.reset();
ds.select(addr); 
ds.write(0xBE); // Read Scratchpad

Serial.print(" Data = ");
Serial.print(present, HEX);
Serial.print(" ");
for ( i = 0; i < 9; i++) { // we need 9 bytes
data[i] = ds.read();
Serial.print(data[i], HEX);
Serial.print(" ");
}
Serial.print(" CRC=");
Serial.print(OneWire::crc8(data, 8), HEX);
Serial.println();

// Convert the data to actual temperature
// because the result is a 16 bit signed integer, it should
// be stored to an "int16_t" type, which is always 16 bits
// even when compiled on a 32 bit processor.
int16_t raw = (data[1] << 8) | data[0];
if (type_s) {
raw = raw << 3; // 9 bit resolution default
if (data[7] == 0x10) {
// "count remain" gives full 12 bit resolution
raw = (raw & 0xFFF0) + 12 - data[6];
}
} else {
byte cfg = (data[4] & 0x60);
// at lower res, the low bits are undefined, so let's zero them
if (cfg == 0x00) raw = raw & ~7; // 9 bit resolution, 93.75 ms
else if (cfg == 0x20) raw = raw & ~3; // 10 bit res, 187.5 ms
else if (cfg == 0x40) raw = raw & ~1; // 11 bit res, 375 ms
//// default is 12 bit resolution, 750 ms conversion time
}
celsius = (float)raw / 16.0;
fahrenheit = celsius * 1.8 + 32.0;
Serial.print(" Temperature = ");
Serial.print(celsius);
Serial.print(" Celsius, ");
Serial.print(fahrenheit);
Serial.println(" Fahrenheit");

///////////////-- FIN DEL CÓDIGO DEL 18B20 --/////////////////////////

client.flush();

// Prepare the response
String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nTemperatura ";
s += celsius;
s += "</html>\n";

// Send the response to the client
client.print(s);
delay(1);
Serial.println("Client disonnected");

// The client will actually be disconnected 
// when the function returns and 'client' object is detroyed
}

      

 

- He tomado el código que hemos visto al principio de la página. Le he insertado en color azul el código correspondiente a la detección de temperatura con el 18B20, que vimos en un tutorial anterior. No he querido reducir este código, simplemente copio y pego, está en azul.

- Ver la conexión en el dibujo de abajo, pero aún debe estar conectado al Arduino, tanto la alimentación como el RX y TX.

- Estando conectado el circuito al Arduino escribimos esto en un navegador web:

192.168.1.7/gpio/1

Observaremos la Temperatura en la página web, también la veremos en el Serial Monitor.

- Esta sería la conexión independiente del Arduino. He configurado la fuente de alimentación con 3,3 V y con 5 V, según indico en la figura. Si no tienes esta fuente de alimentación puedes alimentar al circuito con los 3,3 V y 5 V del Arduino.

- Una vez realizada esta conexión no veremos al Serial Monitor, ya que lo hemos desconectado del Arduino.

- No he querido tocar el código para facilitar su comprensión ya que se pretende una explicación didáctica sencilla.

- Se observa una temperatura de 48,38º, lo cual no es cierto, se deberá retocar el código para obtener la temperatura correcta.

- La salida de datos es:

Data = 1 6 3 4B 46 7F FF C 10 A5 CRC=A5


- La temperatura se obtiene: 3 x 256 + 6 = 774

774 / 16 = 48.38º

__________________________

Este código es más corto que el anterior pero necesita cargar la librería
#include <DallasTemperature.h>

http://milesburton.com/Dallas_Temperature_Control_Library#Download

Código Sensor de temperatura con el 18B20 en el ESP8266
#include <ESP8266WiFi.h>
#include <OneWire.h> //////////////////////////////////
//OneWire ds(2); //////////////////////////////////////
#include <DallasTemperature.h>

OneWire oneWire(2);
DallasTemperature sensors(&oneWire);

const char* ssid = "nombredeturoueter";
const char* password = "contraseñadelrouter";

// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);

void setup() {
Serial.begin(115200);
delay(1500);
sensors.begin();

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");

// Start the server
server.begin();
Serial.println("Server started");

// Print the IP address
Serial.println(WiFi.localIP());
}

void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}

// Wait until the client sends some data
Serial.println("new client");
while(!client.available()){
delay(1);
}

// Read the first line of the request
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();


// Match the request
int val;
if (req.indexOf("/gpio/0") != -1)
val = 0;
else if (req.indexOf("/gpio/1") != -1)
val = 1;
else {
Serial.println("invalid request");
client.stop();
return;
}


////////////////////////-- INICIO DEL CÓDIGO DEL 18B20 --//////////////////////
Serial.print("Requesting temperatures...");
sensors.requestTemperatures();
Serial.println("DONE");
Serial.print("Temperature for Device 1 is: ");
Serial.println(sensors.getTempCByIndex(0));

////////////////////////-- FIN DEL CÓDIGO DEL 18B20 --//////////////////////
client.flush(); // Prepare the response String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n<!DOCTYPE HTML>\r\n<html>\r\nTemperatura "; s += sensors.getTempCByIndex(0); s += "</html>\n"; // Send the response to the client client.print(s); delay(1); Serial.print("Client disonnected"); // The client will actually be disconnected // when the function returns and 'client' object is detroyed }

_____________________________________
3.- Internet. MQTT. Encender/Apagar el LED2 desde Internet. Ver su estado. Standalone.

p117B_ESP82666_mqtt_Extension_Btn_LED.aia

- MQTT es un protocolo utilizado en IOT (Internet de las cosas) para controlar un dispositivo desde Internet.

- En este caso encenderemos/apagaremos el LED2 desde nuestro móvil conectado a Internet. También podemos consultar su estado.

- Para ello se necesita un Servidor en internet, en la nube, a este servidor se denomina Broker, hay muchos de pagos y gratutos, también podemos crear el nuestro en una Raspberry Pi con Mosquitto.

- En este ejemplo utilizaremos el Broker gratuito broker.hivemq.com y el puerto 1883, no es necesario registrarse, ponemos su dirección y su puerto y ya funciona.

- En esta página puedes ver mucha información sobre MQTT y el ESP32: 117_Wemos_MQTT.htm

- Utilizaremos la extensión UrsAI2MQTT

________________________

- Diseño.

________________________

- Bloques.

________________________

- Código ESP8266.

- Es necesario la librería PubSubClient.

MQTT

// http://kio4.com/arduino/57modulowifi_4.htm
// http://kio4.com/arduino/117_Wemos_MQTT.htm
// Juan A. Villalpando


#include <ESP8266WiFi.h> // Para el ESP8266
// #include <WiFi.h> // Para el ESP32
WiFiClient WIFI_CLIENT;
#include <PubSubClient.h>
PubSubClient MQTT_CLIENT;

const char* ssid = "Nombre_Red_WiFi";
const char* password = "Clave_WiFi";

#define LED2 2 
String LED2_status = "-";

void setup() {
  pinMode(LED2, OUTPUT);
  Serial.begin(9600);
  delay(10);
  Serial.println();
  Serial.print("Connecting with ");
  Serial.println(ssid);

  WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}

Serial.println("");
Serial.print("WiFi conected. IP: ");
Serial.println(WiFi.localIP());

// Setting Callback.
  MQTT_CLIENT.setCallback(callback);
}

// What to do when it receives the data. 
void callback(char* recibido, byte* payload, unsigned int length) {
  Serial.print("Message received: ");
  Serial.print(recibido);
  Serial.print("   ");

  for (int i=0;i<length;i++) {
    char receivedChar = (char)payload[i];
    Serial.println(receivedChar);
  if (receivedChar == '1') {digitalWrite(LED2, HIGH);}
  if (receivedChar == '2') {digitalWrite(LED2, LOW);}

    if (digitalRead(LED2) == HIGH) {LED2_status = "LED2 ON";} else {LED2_status = "LED2 OFF";}
  }
}
 
void loop() {
  if (!MQTT_CLIENT.connected()) {
    reconnect();
  }

  // PUBLISH topic.
// Convierte el entero a char. Debe ser char.
char led2_st[10];
LED2_status.toCharArray(led2_st, 10);

MQTT_CLIENT.publish("juan/led2_status", led2_st);
  delay(1000);
MQTT_CLIENT.loop(); // Check Subscription.

}

// Reconecta con MQTT broker
void reconnect() {
MQTT_CLIENT.setServer("broker.hivemq.com", 1883);  
//MQTT_CLIENT.setServer("mqtt.eclipse.org", 1883);
MQTT_CLIENT.setClient(WIFI_CLIENT);

// Trying connect with broker.
while (!MQTT_CLIENT.connected()) {
Serial.println("Trying to connect with Broker MQTT.");
MQTT_CLIENT.subscribe("juan/boton2"); // HERE SUBSCRIBE.

// Wait to try to reconnect again...
delay(3000);
}

Serial.println("Conectado a MQTT.");
}

- Cargamos el Sketch en el ESP8266-01 utilizando el Arduino como hemos visto anteriormente.

- Quita y pon la alimentación, ya que a veces necesita reiniciarse para cargar bien.

 

- Una vez cargado, quitamos el cable GPIO 0 y conectamos un LED en el GPIO 2.

- También podríamos tenerlo conectado al Arduino, en este caso podríamos ver la información mediante el Monitor Serie.

 

________________________________

- Mi correo:
juana1991@yahoo.com
- KIO4.COM - Política de cookies. Textos e imágenes propiedad del autor:
© Juan A. Villalpando
No se permite la copia de información ni imágenes.
Usamos cookies propias y de terceros que entre otras cosas recogen datos sobre sus hábitos de navegación y realizan análisis de uso de nuestro sitio.
Si continúa navegando consideramos que acepta su uso. Acepto    Más información