Here are some relevant threads for work @jpearman did in the past. For the motor speed mapping, look at “motor speed testing” and the extension of that work by @LegoMindstormsmaniac to create a nice look up table. Also, for torque/speed curves, check out the “rev2” thread for better info, the original thread for background, and the “estimating…” thread for good discussion. But all the discussion is good.
motor speed testing:
@LegoMindstormsmaniac’s work:
rev2:
original:
estimating:
Unfortunately, no. It won’t drive output ports when powered by the USB or the 9v backup battery.
As to the increased resolution of the power expander, you can read about it on the second page of this document:
And below is an example task we wrote at EC3 to demonstrate a couple of things. The comments are wordy, because it was meant to explain things to the students.
task monitorPower()
{
// declare some string variables to hold the formatted information
string mainBattery;
string auxBattery;
// turn the integer value representing main battery millivolts into
// a floating point value representing volts. Then, format the
// the information for printing. The "%f" in the format string will be
// replaced by the floating point number calculated by the division.
sprintf(mainBattery," %f Volts",(float)nImmediateBatteryLevel/1000.0);
// The power expander has a voltage sensor port. We plugged a
// jumper wire (VEX extension cable) from the sensor port on the
// power expander to the analog sensor port # 2 on the Cortex.
// The value read by the sensor must be divided by 270 in order to
// convert it into volts. Also, we named the port "power". So:
//
// turn the integer value from sensor port #2 into a floating point value
// representing volts of the battery plugged into the power expander.
// Then, format the information for printing. The "%f" in the format
// string will be replaced by the floating point number calculated by the
// division.
sprintf(auxBattery," %f Volts",(float)SensorValue[power]/270.0);
clearLCDLine(0);
clearLCDLine(1);
displayLCDString(0,0,mainBattery);
displayLCDString(1,0,auxBattery);
// wait 1 second before reading the volts again. Just because.
wait1Msec(1000);
}
Thanks!