GHI.Premium.Hardware - making a servo move

Hi there,

I have a FEZ Panda II and I have flashed the 4.1 firmware along with all the other steps required.

I managed to get the LED to blink, so I know I am able to write to the board without a problem.

I am trying to power a servo, and having some trouble… I followed this example :

However, GHI.Premium.Hardware did not exist, so I followed the steps about install the 4.2 SDK.

I have got the 4.2 SDK installed (not updated any firmware on my board), and I am still having trouble getting this code to compile.

Could somebody please let me know how I connect to a servo on Di6 and how to make it move please?

If I have not been clear enough, please do ask me questions and I will reply asap.

  • Justin

In 4.2, the PWM class is no longer premium it is part of the NETMF core. Change your reference and code to use Microsoft.SPOT.Hardware.PWM.

Welcome to the community!

Hi ianlee74,

Apologies for the delayed reply, I’ve had quite a busy day in the office today.

I have tried to add a reference Microsoft.SPOT.Hardware.dll file within the 4.2 folder, however Visual Studio keeps on adding a reference to the file found within the 4.1 folder. I don’t suppose you (or anybody else), would know how to get Visual Studio to grab the files I have chosen by chance? I don’t want to risk trying to register them in the GAC if that might end up causing me more trouble, so would rather ask first.

  • Justin

Hey fellow J

You have to stick with 4.1 on the Panda. I have some code floating around but it’s dinner time in Hertfordshire so can’t get to it just yet…

Hey Justin,

No problem at all, I’ll be online all evening so if you get a chance to find some sample code for getting a Servo moving with 4.1 later this evening, I would really appreciate it, thank you!

  • Justin

Have a squizz here http://www.tinyclr.com/codeshare/entry/53

Hey Justin,

Thanks for the link, I got it compiling however I am not sure if I am using it correctly as it’s not moving my servo (and I can confirm the servo moves with an Arduino).

The code I am using is as follows:

public static void Main()
{
var servo = new Servo(FEZ_Pin.PWM.Di6);
while (true)
{
servo.Degree = servo.Degree++;
Thread.Sleep(100);
}
}

Perhaps I am missing something obvious?

  • Justin

Hi Justin,

Thanks for your help, it turned out that I needed to supply some extra power to the board to power the servo. Works beautifully, thank you very much!!

  • Justin

sweet, yeah servo’s tend to munch thru the power. Enjoy the journey :slight_smile: