I can’t connect with the internet, this is my topic.
#include <ESP8266wifi.h>
#include <BlynkSimpleEsp8266.h>
#define BLYNK_PRINT Serial
// Define pin connections
const int enablePin = 0; // ESP8266 digital pin 0
const int stepPin = 4; // ESP8266 digital pin 4
const int dirPin = 5; // ESP8266 digital pin 5
// Define Blynk ports
bool TuneRight = false;
bool TuneLeft = false;
bool FineTuneRight = false;
bool FineTuneLeft = false;
bool Scan = false;
// Define networking parameters
char auth[] = "Blynk"; // set the Blynk authentication code
char ssid[] = "My SSID"; // set the WiFi SSID
char pass[] = "My Password"; // set the Wifi password
// -- Start of Setup ---------------------------------------------------------------------------------------------------------------------
void setup(){
Serial.begin(115200); // baudrate for serial communication
Blynk.begin(auth, ssid, pass); // network information
// Declare pins as Outputs
pinMode(stepPin, OUTPUT); // step pin
pinMode(dirPin, OUTPUT); // direction pin
pinMode(enablePin, OUTPUT); // enable pin
pinMode(LED_BUILTIN, OUTPUT); // onboard LED indicator
}
BLYNK_WRITE(V0){ // Blynk virtual pin V0
TuneLeft = param.asInt(); // turn left
}
BLYNK_WRITE(V1){ // Blynk virtual pin V1
TuneRight = param.asInt(); // turn right
}
BLYNK_WRITE(V2){ // Blynk virtual pin V2
FineTuneLeft = param.asInt(); // fine tuning Left
}
BLYNK_WRITE(V3){ // Blynk virtual pin V3
FineTuneRight = param.asInt(); // fine tunning Right
}
BLYNK_WRITE(V4){ // Blynk virtual pin V4
Scan = param.asInt(); // scan
}
// -- Main Tunning Function ---------------------------------------------------------------------------------
void Tunning (int Steps, int Rotation){
digitalWrite(enablePin, LOW); // enable the driver
for (int i = 0; i < Rotation; i++){ // loop for motor steps
digitalWrite(stepPin, HIGH); // perform a step
digitalWrite(LED_BUILTIN, LOW); // turn LED indicator OFF
delayMicroseconds(Steps); // wait for the steps operation
digitalWrite(stepPin, LOW); // stop the step
digitalWrite(LED_BUILTIN, HIGH); // tuen LED indicator ON
delayMicroseconds(Steps); // wait between steps
Blynk.run();
}
}
// -- Start of loop -------------------------------------------------------------------------------
void loop() {
Blynk.run();
digitalWrite(enablePin, HIGH); // disable the driver - will save power and heat on the motor driver
if (TuneRight){ // turn right
digitalWrite(dirPin, LOW); // set direction to one side
Tunning(1500, 320); // turn in normal speed
}
if (FineTuneRight){ // fine turn right
digitalWrite(dirPin, LOW); // set direction to one side
Tunning(3000, 16); // turn slow, aka "Fine Tune"
}
if (TuneLeft){ // turn left
digitalWrite(dirPin, HIGH); // set direction to the other side
Tunning(1500, 320); // turn in normal speed
}
if (FineTuneLeft){ // fine turn left
digitalWrite(dirPin, HIGH); // set direction to the other side
Tunning(3000, 16); // turn slow, aka "Fine Tune"
}
while (Scan) { // scan as long as the App button is enable
digitalWrite(dirPin, LOW); // set scan direction to one side
Tunning(1000, 16); // scan quickly, aka "Fast Tune"
}
}
// -- End of loop ---------------
The code I get on the second monitor is
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 3460, room 16
tail 4
chksum 0xcc
load 0x3fff20b8, len 40, room 4
tail 4
chksum 0xc9
csum 0xc9
v00045580
~ld
Best regards, Gerrit