Mindstorms.EV3 1.0.3

dotnet add package Mindstorms.EV3 --version 1.0.3                
NuGet\Install-Package Mindstorms.EV3 -Version 1.0.3                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mindstorms.EV3" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mindstorms.EV3 --version 1.0.3                
#r "nuget: Mindstorms.EV3, 1.0.3"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Mindstorms.EV3 as a Cake Addin
#addin nuget:?package=Mindstorms.EV3&version=1.0.3

// Install Mindstorms.EV3 as a Cake Tool
#tool nuget:?package=Mindstorms.EV3&version=1.0.3                

Lego Mindstorms EV3 (Firmware: V1.09H)

Connect to brick

var brick = new Brick("COM1"); // Note that you need to find the correct COM port to connect.
brick.Connect();

Using the speaker

Play a melody

brick.PlayMusic(new KisKeceLányom());

Turn on the speaker

brick.Beep(frequecncy, durationInMs);

Turn off the speaker

brick.Silence();

Play embedded sounds

brick.PlaySound(EmbeddedSound.ElephantCall, PlayType.PlayOnce);

Using the motors

Set motors

brick.SetMotors(OutputPort.B, OutputPort.C, OutputPort.D);

Start motors with different speed

var leftMotorSpeed = 100; // Minimum: -100, maximum: 100
var rightMotorSpeed = -100;
brick.SetMediumMotorSpeed(DaisyChainLayer.EV3, new SetMotorSpeedParams(brick.LeftMotor, leftMotorSpeed), new SetMotorSpeedParams(brick.RightMotor, rightMotorSpeed));

Stop Motors

brick.SetMediumMotorSpeed(DaisyChainLayer.EV3, new SetMotorSpeedParams(brick.Motors, 0));
or
brick.StopMotor(DaisyChainLayer.EV3, brick.Motors, BreakType.Break);

Using the screen

Clear the screen

brick.ClearScreen();

Any drawing will be shown after this command is called

brick.UpdateScreen();

Put a pixel on the screen

brick.PutPixel(10, 10, LCDColor.Black);
or
brick.PutPixel(new EV3Point(10, 10), LCDColor.Black);

Draw text on screen

brick.DrawString(10, 10, "Hello World!", LCDColor.Black, FontType.Normal);
or
brick.DrawString(new EV3Text(new EV3Point(10, 10), "Hello World!"));

Create an IEV3DrawingElement

IEV3DrawingElement element = new EV3Circle(50, 50, 20, true);
or
IEV3DrawingElement element = new EV3Line(50, 50, 100, 100);
or
IEV3DrawingElement element = new EV3Point(10, 10);
or
IEV3DrawingElement element = new EV3Rectangle(10, 10, 90, 90, false);
or
IEV3DrawingElement element = new EV3Text(10, 10, "Hello World!");

Draw an IEV3DrawingElement on the screen

brick.Draw(element, LCDColor.Black);

Start a game

var snakeGameEngine = new SnakeGameEngine(brick);
snakeGameEngine.GameLoop();
or
var circlesGameEngine = new CirclesGameEngine(brick);
circlesGameEngine.GameLoop();
Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.8

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.3 526 6/9/2022
1.0.2 434 5/28/2022
1.0.1 409 5/28/2022
1.0.0 417 3/31/2022

Lego Mindstorms EV3 NuGet package.
1.0.3: Copy Resources content into consuming project bin folder.
1.0.2: NuGet package extended with Mindstorms.Game assembly and Utils depenedency assembly.
1.0.1: Wrong package - DO NOT USE IT!
1.0.0: Contains only Mindstorms.Core assembly.