I am still trying to get the Mini to control the Boe-Bot. using code from your e-book (which is excellent by the way) I need to send PWM to pin 12 on the bot. Trouble is, the enumeration for PWR pins does not include pin 12. Here is the code.
public static void Main()
{
try
{
PWM servo = new PWM((PWM.Pin)FEZ_Pin.PWM.Di5);
while (true)
{
// 0 degrees. 20ms period and 1.25ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1250 * 1000);
Thread.Sleep(1000);//wait for a second
// 90 degrees. 20ms period and 1.50ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1500 * 1000);
Thread.Sleep(1000);//wait for a second
// 180 degrees. 20ms period and 1.75ms high pulse
servo.SetPulse(20 * 1000 * 1000, 1750 * 1000);
Thread.Sleep(1000);//wait for a second
}
//Thread.Sleep(-1);
}
catch (Exception ex)
{
Debug.Print("An error occurred " + ex.Message.ToString());
}
}
}
Is there a way to “map” a Fez pin to a different output pin for the boe-bot? The servos on the Boe-Bot are on Pins 12 & 13.
I am sooooo close to making this work!
PWM is (unfortunately for you) enabled only on a set number of defined pins. The only way to achieve what you want is to connect a PWM capable pin to the expected connection on the Bot. So your “re-map” is really going to be a “rewire”.
(PS: using CODE tag helps )
I guess i can wiki my boe bot conversion soon. I had it almost complete with all the book samples converted to .net. Will have to be after the up and coming robot meet i am preparing for.