Ok, so I updated some code and attached the wiring diagram of what I've done. I plotted a serial output (also attached) to see what kind of data I'm getting from the current sensing pins. I'm just looking for curves that show a change when the motor feels an external load (i.e. my fingers holding the motor), so I don't necessarily need the analog readings (0-1023) to be translated into amps.
In the serial plotter picture, the parts that I've circled correspond to when I apply slight pressure to the motor shaft with my fingers (not enough pressure to stall). No matter how much pressure I put, I get a full 1023 reading. I want to see a curve corresponding to the amount of load I apply to the motor, but I seem to be getting readings that don't really make sense. Can anyone help?
/*
* BTS7960 Motor Driver Code
*/
int RPWM = 3;
int R_EN = 4;
int R_IS = A0;
int LPWM = 5;
int L_EN = 6;
int L_IS = A1;
void setup() {
//Set up input/output pins
Serial.begin(9600); //Initialize Serial monitor
pinMode(RPWM, OUTPUT);
pinMode(R_EN, OUTPUT);
pinMode(LPWM, OUTPUT);
pinMode(L_EN, OUTPUT);
}
void loop() {
digitalWrite(R_EN, HIGH);
digitalWrite(L_EN, HIGH);
digitalWrite(LPWM, LOW);
digitalWrite(RPWM, HIGH);
float currentR = analogRead(R_IS);
float currentL = analogRead(L_IS);
Serial.print(currentR);
Serial.print(" ");
Serial.println(currentL);
}