This repo is a .Net implementation of CyberGear.
Using the builder pattern to build CanBus
.
var builder = CanBus.CreateBuilder(SlotType.Usb, 1);
builder.Configure(opt =>
{
// set can bitrate, which default value is Pcan1000
opt.Bitrate = Bitrate.Pcan1000;
// set masteridd which default value is 0
opt.MasterId = 0;
// add motor can id range
opt.AddMotors(new uint[] { 2, 127 });
});
CanBus can = builder.Build();
Where are the motors?
var motor0 = can.Motors[0];
var motor1 = can.Motors[1];
var motorFeedback = await motor0.SetMechanicalZeroAsync();
- Please use a PCAN compatible device
- PEAK official website driver
- Download
Peak.Can.Basic(4.8.0.830)
throughnurget
- Example:
CyberGearPlayground