Other Parts Discussed in Thread: CONTROLSUITE
Hello,
I currently have a motor hooked up to an H-bridge and I am supplying the voltage to the H-bridge through a power supply. I have a current sensor in series with the H bridge.
I have a Vout from the current sensor that tells me how much voltage, and I can get the current by dividing it by the gain. The Vout is hooked up to my f28335 at A0 and i would like to turn the motor off at a certain voltage.
I am trying to set a condition so that when the digital input is above a certain number call the function that stops the motor. It does not seem to be working right now.
Sample code is below:
for (i = 0; i <1000 ; i ++)
{
voltage = (AdcRegs.ADCRESULT0>>4);
}
if(voltage > 2300)
Stop();
Does the bit shifting effect the number I am comparing against? Can i compare against the input value?