Chat freely about anything...

User avatar
By WirelessThings
#22745 This is my first ESP8266 project and it seems like there are a million ways to go about this. I'm left quite confused about what method I should choose.

The stepper motor will raise and lower and projector screen. Motor is driven by an A4988, just needs two inputs, step and direction. Currently using this code written in basic on a picaxe chip. It moves the motor a certain number of steps in one direction, then writes whether it's up or down to eprom so the next input will still reverse the motor with a power loss.

Code: Select allinit:
read b1,b0

Main:


if pinc.3 = 1 then
   if b0 = 1 then goto rollup
   if b0 = 0 then goto rolldown
endif

pause 10

goto main



rollup:

high c.2 ;direction

for w7 = 1 to 1000 ;steps to make

low c.1

pauseus 3

high c.1

pauseus 30 ;pause between steps

next w7

w7 = 1

b0 = 0
write b1, b0

goto main




rolldown:

low c.2 ;direction

for w7 = 1 to 1000 ;steps to make

low c.1

pauseus 3

high c.1

pauseus 30 ;pause between steps

next w7

w7 = 1

b0 = 1
write b1, b0

goto main


Now, do I want to use NodeMCU or arduino IDE? I have no idea. Do I want to connect the 8266 to thingspeak and control the motor from there, or should the 8266 be an access point that I connect to, to control? Or should it host a webpage on my local network I keep in the favourites on my phone, access it from the browser and control from there? And where does the HTTPD webserver come into play?

I really don't know where to begin or why I'd want to choose one method over the other. Controlling the screen from anywhere in the world isn't necessary, but not a bad thing either.

Thanks for any help you can offer.
User avatar
By frob
#22778 Thats a great idea!-
i'd like to do that with my home theater screen as well.
Have you thought about what the "input" user interface will be to control it?
do you want to write your own android or iphone app, or use a web browser to access a simple web page?
In my case i would want to make it even simpler - avoid the phone , i would want the screen to come down automatically when the projector powers up, and closes when its turned off.
My projector is an old one, but it does have an ethernet jack so it can be pinged on my lan -
what i would do is just have the ESP8266 ping the projector and open the screen anytime it gets a response.

In theory you can do it all within the ESP8266, but its easier for me to split the code in 2 :
ESP8266 generates an up/down signal on an I/O pin,
and another microcontroller manages the motor, power and end-stop switches.
It might be even easier to just do all the control in the external micro, like arduino, and just use the AT commands to control the ESP8266.
You could also have the device power-up and configure the surround-sound receiver in movie mode (select the right inputs, set decoding mode, volume, etc..) by using an IR Led to act as its remote control :-)
Cheers
Frantz
User avatar
By JohnQ
#25817 Hi,
I have been using this Arduino Shield without problems so far:
https://jjrobots.com/product/b-robot-el ... ield-v2-0/
The PCB can be used to move two stepper motors and two servos. Is mounting the ESP12-E module. Clean and cheap.
You can control this SHIELD from your phone using WIFI. There is some code already done in the page

Cheers