The motors do not have to have speed control, or anything other than if i press a button, they should spin the way i programmed to(back and forth).
(this is not a coding question)
What would be the best ????Driver/relay/transister????( not very experienced with any of these) that would be able to do that?????(not too expensive but also not extremly cheap)
And what kind of power source would if have to have to drive all of this?????
This is what i am basing my project off from. I know i will need two of those l293n chips.
Will i need a better power supply/different board for this project?
This is my current code but am going to upgrade it to 4 motors
#include <IRremote.h> //including the remote library
#define Next_button 60891 // code received from next button
#define Prev_button 49467 // code received from previous button
#define left_button 58747 // code received from left button
#define right_button 15355 // code received from right button
#define Stop_button 7611 // code received from stop button
int receiver_pin = 2; //output pin of IR receiver to pin 2 of arduino
//initializing the pins for leds
int left_motor1 = 11; //pin 6 of arduino to pin 7 of l293d
int left_motor2 = 12; //pin 7 of arduino to pin 2 of l293d
int right_motor1 =6; //pin 5 of arduino to pin 10 of l293d
int right_motor2 = 5; //pin 4 of arduino to pin 15 of l293d
IRrecv receiver(receiver_pin); //Arduino will take output of IR receiver from pin 2
decode_results output;
void setup() {
Serial.begin(9600);
receiver.enableIRIn(); // Start to take the output from IR receiver
//initializing all the pins where we have connected the led's as output pins
pinMode(left_motor1, OUTPUT);
pinMode(left_motor2, OUTPUT);
pinMode(right_motor1, OUTPUT);
pinMode(right_motor2, OUTPUT);
}
void loop() {
if (receiver.decode(&output)) {
unsigned int value = output.value;
switch(value) {
case Next_button:
digitalWrite(left_motor1,LOW);
digitalWrite(left_motor2,HIGH);
digitalWrite(right_motor1,HIGH);
digitalWrite(right_motor2,LOW);
break;
case Prev_button:
digitalWrite(left_motor1,HIGH);
digitalWrite(left_motor2,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,HIGH);
break;
case left_button:
digitalWrite(left_motor1,LOW);
digitalWrite(left_motor2,HIGH);
digitalWrite(right_motor1,HIGH);
digitalWrite(right_motor2,HIGH);
break;
case right_button:
digitalWrite(left_motor1,HIGH);
digitalWrite(left_motor2,HIGH);
digitalWrite(right_motor1,HIGH);
digitalWrite(right_motor2,LOW);
break;
case Stop_button:
digitalWrite(left_motor1,LOW);
digitalWrite(left_motor2,LOW);
digitalWrite(right_motor1,LOW);
digitalWrite(right_motor2,LOW);
break;
}
receiver.resume();
}
}