I have a setup I am attempting to code but if the Hardware is not designed for the usage, I may have to start from scratch.
My set up is a 12V DC power supply, which powers a L298n motor controller driving two Worm Drive DC motors.
I have opted to us a WEMOS D1 Mini powered by the 5v from the L298n. My inputs would be D1-D4 and my Outputs would be D5-D8.
D1 - D4 would be 4 Push Button Switches(INPUTS)
D5 - D8 would be 2 Motors with 2 directions (OUTPUTS) LOW and HIGH
My question is can D1 through D4 be used as switch inputs (10k Resistors attached)
And is there any prevention in using D5 - D8 for the OUTPUT signals directing the motors (HIGH, LOW) /(LOW,HIGH)?
My code calls it up as you would suspect, but without knowing the ability of the D1 Mini to handle the code
my fears are frying the chip due to the LOW or HIGH originating status's of the PINS.
Ive read several articles on using the PINS for specific tasks but when I get to the anatomy of the PINs I begin to get lost on my code. My code identifies the pins as high or low inputs on the closure of the switch but either the one motor runs continuously or the other motor does not respond.
My thought is that you cannot use 4 analog inputs on D1-D4. and I would have to use two WEMOS D1s to have my desired outcome. I have also looked at using the ESP32 but the same preset pins are causing more confusion.
Can anyone out there wade through my confusion here and point me in the right direction? Or should I just take up needlepoint.
I have attached a picture of something close to what I am trying to do. without the motors. I would simply use the led OUTPUTS in the picture with MOTORS. of course with 4 buttons.
I copied the chart below from: ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials This will give you an idea of what you can do. Many of the pins have other uses other then general I/O especially at reset-boot time.
zin the WeMos D1, the pins are not independent as they are on the UNO. Several GPIOs are connected to two more points on the board. I could not post the picture but you can search for “WeMos D1 pinout” and get the drawing and schematic.
no PWM or I2C support
HIGH at boot used to wake up from deep sleep
often used as SCL (I2C)
often used as SDA (I2C)
connected to FLASH button, boot fails if pulled LOW
HIGH at boot connected to on-board LED, boot fails if pulled LOW
pulled to GND
SPI (CS) Boot fails if pulled HIGH
HIGH at boot
HIGH at boot debug output at boot, boot fails if pulled LOW
In neither Fritzing diagram have the buttons been wired correctly.
It is usual to wire the button between the Arduino pin and ground. In the sketch, you explicitly switch on the button’s pull up resistor using the INPUT_PULLUP parameter of the pinMode() function. The Arduino pin, to which the button is connected, should never be allowed to float.
I have wrote them as Read - LSDin in one of the 4. LSDin = D2 then I identify LSDin as buttonStateLeftSideDown? I really don't know what you are referring to as what you stated. D1 through D4 are inputs. Unless you are speaking of how I hard wired it wrong.
In reply #4 you have buttons (so inputs) and LEDs (so outputs) connected to the same pins, this is all wrong. If you want D1 to D4 to be inputs for the buttons then you need to connect just buttons, not LEDs. Reply #5 tells you how to connect them.
There is a similar discussion here that might help you:
What happened to your replies in here, it looks like you deleted many of them.
Doing that is considered vandalism, it makes a mess of the topic and means it no longer makes sense to anyone reading it. Please can you leave your replies in place for your other questions? The answers you get are not just for you, they are for anyone else reading this who has a similar problem.