Help to activate outputs WITHOUT the app

Hola, Quisiera saber como puedo activar salidas SIN usar la app BLYNK, en éste código tengo unas salidas que las activo sin necesidad de usar la app (es para usar un motor paso a paso), pero cuando la subo al microcontrolador no reacciona, es decir, no me activa las salidas, si alguien me puede decir algún link donde yo pueda investigarlo o corregirme en algo estaría muy agradecido.

Algo más. comenté el ciclo de un servo motor. No entiendo porque ese código sí me funcionó con el servo, pero cuando quiero probar el motor paso a paso no me activa salidas.

…31/10/2018
Probé de nuevo el código del servo motor, ya no funciona ninguno.


#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

#include <Servo.h>

char auth[] = "xxxxxxxxxxxxxxx";


char ssid[] = "xxxxxx";
char pass[] = "xxxxxxxxxxxxxx";

Servo servo;
float temp=0;

BLYNK_WRITE(V1)
{
  servo.write(param.asInt());
}
void setup()
{
  // Debug console
  Serial.begin(115800);

  Blynk.begin(auth, ssid, pass);
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
    servo.attach(5);
}

void loop()
{
//SERVO

//for(int i=0;i<=50;i++)
//{
//  digitalWrite(5, HIGH);
//delayMicroseconds(400);
//digitalWrite(5, LOW);
//delay(20);}
//
//for(int i=0;i<=50;i++)
//{
//  digitalWrite(5, HIGH);
//delayMicroseconds(2200);
//digitalWrite(5, LOW);
//delay(20);}              //FUNCIONÓ !!!


//PAP

//digitalWrite(16, HIGH), digitalWrite(5, HIGH), digitalWrite(4, LOW), digitalWrite(0, LOW);
//delay(50);
//digitalWrite(16, LOW), digitalWrite(5, HIGH), digitalWrite(4, HIGH), digitalWrite(0, LOW);
//delay(50);
//digitalWrite(16, LOW), digitalWrite(5, LOW), digitalWrite(4, HIGH), digitalWrite(0, HIGH);
//delay(50);
//digitalWrite(16, HIGH), digitalWrite(5, LOW), digitalWrite(4, LOW), digitalWrite(0, HIGH);
//delay(50);              //NO ME FUNCIONÓ


  Blynk.run();
}

don’t forget backtiks ``` to format31-024925

got it… thanks

1 Like

@Gunner is the best for that

1 Like

I’m reading some of your publications, and they are helping me to better understand the way of programming, thanks man…

my english is not good, sorry

2 Likes

creo que no logro entender por completo las funciones :confused:

hasta ahora llevo esto, pero ya no sé qué está mal, alguna recomendación? disculpen por la pregunta, sé que debe ser básica.

lo único que quiero hacer es activar y desactivar una salida con la función “void paso” indefinidamente, es decir, estar haciéndolo todo el tiempo.


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "xxxxxxxxxxxxxxxxxxxxxx";

char ssid[] = "x";
char pass[] = "x";

BlynkTimer timer;

void paso()
{
digitalWrite(16, HIGH);
delay(50);
digitalWrite(16, LOW);
delay(50);
}

void setup()
{
  Serial.begin(115800);

  Blynk.begin(auth, ssid, pass);
    timer.setInterval(1000L, paso);
}

void loop()
{
Blynk.run();
timer.run();
}

what is your problem with this sketch?

What does this have to do with your title and OP (original post) request?

Look at some of my examples… (in the link provided above… there is many in that topic alone) wherein I use flags and App buttons or conditions to “enable/disable” or change other end results of a regularly timed function. Or even stop a timer altogether and restart it.

That was what I did, look at some examples and I managed to understand a little better how to program, sorry for the english, and thanks

the program worked for me, I just had to declare the outputs in the void setup… thanks