I am currently in the process of writing the drivers for this board (because I will use it) and I have a question. :think:
The DC motors driver and the Servo driver are almost identical to those provided by GHI. In fact, it’s nearly a copy/paste of their drivers. Roughly, only pinout has changed and cannot be changed/chosen by the user.
Two reasons for doing this : maximize compatibility with existing programs that use the shields sold here and not reinvent the wheel.
My question here is : how can I give credits to GHI in “my” drivers ? I’m not very familiar with licenses terms and don’t want to steal someone else work
For example, here’s the servo driver :
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.Hardware;
using GHIElectronics.NETMF.FEZ;
namespace PandaMotorsDriver
{
public class PandaServo
{
OutputCompare _servo1,_servo2,_servo3,_servo4;
uint[] timings = new uint[5];
public PandaServo()
{
_servo1 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO68, true, 5);
_servo2 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO61, true, 5);
_servo3 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO62, true, 5);
_servo4 = new OutputCompare((Cpu.Pin)FEZ_Pin.Digital.IO63, true, 5);
}
public void SetPosition(byte angle_degree)
{
SetPosition(1, angle_degree);
}
public void SetPosition(byte servo, byte angle_degree)
{
uint pos = (uint)(((float)((2500-400) / 180) * (angle_degree)) + 400);
timings[0] = pos;
timings[1] = 50000;
switch (servo)
{
case 1: _servo1.Set(true, timings, 0, 2, true);
break;
case 2: _servo2.Set(true, timings, 0, 2, true);
break;
case 3: _servo3.Set(true, timings, 0, 2, true);
break;
case 4: _servo4.Set(true, timings, 0, 2, true);
break;
}
}
}
}
As you can see, there’s not much difference in code.