Hey there.
Im fairly new to Blynk and appreciate your Work!
Im Working on a self-made Macro Rail for Photography and found a very useful code (in commentary section)
since I dont have a wifi shield for my Arduino and some Nodemcu’s laying around, I want to use it instead of the Arduino.
The “basic” code works finde without any issues but when I start to implement some of those “Wifi connection samples” from the Arduino IDE it won’t compile because of “multiple variable definitions”
Hey there,
Please post your sketch here instead of external link and make sure to add triple backticks at the beginning and the end of your sketch, triple backticks look like this```, and give more details.
I’ve changed the sketch so that it will work with a NodeMCU, here is the revised first part of the code. Noithing beyond void setup has changed, so I’ve not included that part…
#define BLYNK_PRINT Serial
#define BLYNK_MSG_LIMIT 0
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
char auth[] = "blynk key";
char ssid[] = "wifi ssid";
char pass[] = "wifi pass";
const int stepPin = 13;
const int dirPin = 12;
const int shutterPin =14;
bool moveForward = false;
bool moveBackward = false;
const double pitch = 2; // pitch in mm
const double stepAngle = 1.8; // angle per step
double distance = 0;
double numImages = 0;
bool runIt = false;
bool autoMode = false;
double startStep = 0;
double endStep = 0;
double currentStep = 0;
void terminalout(String out)
{
Blynk.virtualWrite(V2, out + "\n");
}
void setup()
{
/*
Sets the two pins as Outputs
*/
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(shutterPin,OUTPUT);
Serial.begin(74880); // This should be the native baud rate for your NodeMCU
Blynk.begin(auth, ssid, pass);
}
I have to say that there are some parts of the code that are far from ideal, such as the cluttered void loop and the use of blocking delay commands, but this should at least get you started.
I’d be interested to see what sort of results you obtain. Setting-up a macro focus stacking rig is one of the things on my "to-do- list, but i think I’d want to invest a reasonable amount in a good linear stepper slide, and that side of the project gets expensive.
Thank you PeteKnight!
The code does still not wok and im unable to figure out why.
My Errors: https://pastebin.com/X1SqMVgZ
I will share my 3D Models and Schematics if it works.
“Extreme Macro Photography” is very expensive, my Controller should work with any Stepper Motor when its finished.
iI Printed the rail to, the full Project costs about 30 Dollars but I think I will buy a more massiv (full metal" Linear Rail from Aliexpress. I think my Canon 6D could be way to heavy for the Printed one.
I will share some pictures later this day if you want?
30 Dollars is pretty cheap if you compare it to a Stackshot or something else.
The Controller should be able to run every Stepper Motor from 12v to 24v. (:
Im using the Blynk Libary 1.0.1, should I install another one?
Yes, and you’ll get a $30 paperweight that will be good for nothing, then you’ll end-up buying a $200 linear slide (depending on the travel that you want) and the $30 will have been a waste of time and effort.
As you’re using the Legacy app you should be using version 0.6.1
Did you install 1.0.1 via the Arduino IDE ?