I’m making a line follower
Using Dual MC33926 Motor Driver Carrier, someone could help me with the code for Arduino to work with 2 motors
I have a code but it only works with 1 motor
[code]#define stby 7
#define motoryon1 10
#define motoryon2 9
#define current 5
unsigned long time;
float sum=0;
int turn=50;
float result;
float akim;
void setup(){
pinMode(stby,OUTPUT);
pinMode(motoryon1,OUTPUT);
pinMode(motoryon2,OUTPUT);
pinMode(current,INPUT);
digitalWrite(stby,HIGH);
Serial.begin(9600);
digitalWrite(motoryon1,HIGH);
}
void loop(){
time=millis();
akim=analogRead(current);
Serial.print(akim);
Serial.print(",");
Serial.println(time);
}
[/code]