Skip to content

slaveOftime/Fun.LEGO.Spike

Repository files navigation

Fun.LEGO.Spike Nuget

Currently this library will use USB to connect to LEGO Spike hub 3 to interact it's python REPL. And it is just a dumb csharp wrapper to send python code to REPL and wait printed result from serial port.

Supported wrapper:

  • LightMatrix
  • ColorSensor
  • Motor
  • MotorPair

How to use it

using var services = new ServiceCollection()
	.AddLogging()
	.Configure<HubReplOptions>(options => options.PortName = "COM5")
	.AddSingleton<IHubRepl, HubRepl>()
	.BuildServiceProvider();

var hub = services.GetRequiredService<IHubRepl>();
await hub.Connect(autoRetry: true);

var lightMatrix = new LightMatrix(hub);
await lightMatrix.SetOrientation(LightMatrixOrientation.LEFT);
await lightMatrix.Show(LightMatrixImage.IMAGE_BUTTERFLY);

About

csharp/dotnet wrapper for LEGO spike 3 hub repl

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published