50 Replies
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
here is a detailed post on the 298 with proper wireing options. https://supperslash.wixsite.com/arduinobasics/l298n
ArduinoBasics
L298N | ArduinoBasics
NOTE 9v batterys are not good for motors.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
may want to check if the button has pullups
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
!pullup
What does pullup (or pulldown) mean, and how do I use it?
Pins used as INPUT should not be left unconnected (floating).
This can lead to undesired behavior. If input pins are connected to digital sensors then the sensor itself usually keeps the pin either HIGH or LOW.
Pins used with switches (pushbuttons or other) should use a resistor to 'pull' the pin HIGH or LOW.
If the pin is connected to Vcc through a resistor it is said to be 'pulled up', if the pin goes to ground through a resistor it is said to be 'pulled down'. When a resistor is used this way the input is held at either Vcc or ground when the switch is not closed so that it is never 'floating'. Pins that are pulled down are normally LOW and go HIGH when the switch (wired to Vcc) is closed. Pins that are pulled up are normally HIGH and go LOW when the switch (wired to ground) is closed. (The resistor, often 10K, allows only a small current to flow from Vcc to ground when the switch is closed, if the pin was tied directly to a power rail closing the switch would short out the power supply!)
Many chips include internal resistors so that an external resistor doesn't need to be added to your circuit.
On the ATmega328P chips used on many Arduino boards you can pull up the pin by using
pinMode(pin, INPUT_PULLUP)
. If the pin is declared this way it is normally HIGH and all that is needed is a switch wired from the pin to ground. When the switch is closed the pin will go LOW. The example below shows pin 2 setup this way.
Arduino Bot • Submit bugs on GitHub!
@Tophgreat point but RN the motor is not moving at all, so I figured there would be a good place to start, I know the code had an error in it but we are waiting on a wirediagram first.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
yup... seeing how everything is connected will allow MaderDash to help
conect your motor/s like this

Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
ok let me know when you have that done
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
if you just follow that example I gave there should be everything you need there.
even some basic test code?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
use the B example for the powering

Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
correct, but for now you shouldent and just power the board by USB, because the battery may not be able to provide enough power currently so stick with wireing B till it passes the tests please?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
correct.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
after we get things working better, then we can just add that wire. PLUSS REMEMBER::: You never want to supply anything to the 5v pin and the USB. you only conect ONE AT A TIME or you can take out your pc's USB port.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
Looking good now unhook the bat, so it does not go dead
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
last wireing to do is:

Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
If you want to use others, let me know what pins you want to use and I will change code for you.'
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
there is 4 pins
so please let me know what you want to use
@Grogu (Rey)
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
13,9 is for motor A and 12,10 for motor B?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
dubble check that and I will code
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
is the pin mapping correct?
13,9 motorA
12,10 motorB ?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
ok
Test code here
upload this code and see if the motors spin after reconecting the 9v
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
keep it conected.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
GREAT. NOW lets see what you can understand about the code. Power down the project as you cdont want the battery to die.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
it will as its pushing all the power through this is why we did not conect the arduino to that board also it would make it get even hotter. 😮
Ok so what do you understand about the code I sent you?
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View
got it lets work ont hat part.
lets go to coding help and you can mark this thread as solved it would be great.
Unknown User•4y ago
Message Not Public
Sign In & Join Server To View