Anyone have updated brushless motor code?

Hi all,

I am having the hardest time with this class. I am converting it to VB.NET but it appears I have hit a brick wall when it comes to my abilities. Maybe someone can help me bring this code up to the latest SDK am using 4.2. It can be in C# I can do the conversion once I have a working class.

https://www.ghielectronics.com/community/codeshare/entry/36

Thanks,
Kevin

The best way to learn would be to describe what you have done and what problems you are experiencing.

I am having difficulty for example with anything that references “PWM”. I am assuming this brushless motor class was made prior to 4.2 SDK and the namespaces have been restructured.

public BrushlessMotor(PWM.Pin pin, Periods period)
{
Period = (uint)period;
this._pwmPin = new PWM(pin);
this._pwmPin.SetPulse(Period, Min);
}

In the method above I cannot get past “PWM.Pin” from showing “The type or namespace name “PWM” could not be found…”

I have searched and have come up empty.

I went to the support area of the forum and found a document about PWM.

https://www.ghielectronics.com/docs/18/pwm

Does this help?

Thank you Mike! You ever get stuck on a problem and go round and round when the answer is staring you right in the face? :slight_smile:

This is the code I just used to put the brushless motor controller into programming mode.

static GT.Interfaces.PWMOutput esc;

esc = breakout.SetupPWMOutput(GT.Socket.Pin.Nine);

esc.SetPulse(20 * 1000000, 20 * 100 * 1000);