-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Created SimpleMediumLinearMotor #58 non-breaking Co-authored-by: Menno Lodder <menno@lodder>
- Loading branch information
1 parent
ede729d
commit 996beac
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/SharpBrick.PoweredUp/Devices/SimpleMediumLinearMotor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using SharpBrick.PoweredUp.Protocol; | ||
using SharpBrick.PoweredUp.Utils; | ||
|
||
namespace SharpBrick.PoweredUp; | ||
|
||
/// <summary> | ||
/// SimpleMediumLinearMotor, advertised as Motor, only supports power mode, this works for the WoDo 2.0 Medium (LPF2-MMOTOR) | ||
/// </summary> | ||
public class SimpleMediumLinearMotor : BasicMotor, IPoweredUpDevice | ||
{ | ||
public SimpleMediumLinearMotor() | ||
: base() | ||
{ } | ||
public SimpleMediumLinearMotor(ILegoWirelessProtocol protocol, byte hubId, byte portId) | ||
: base(protocol, hubId, portId) | ||
{ } | ||
|
||
public IEnumerable<byte[]> GetStaticPortInfoMessages(Version softwareVersion, Version hardwareVersion, SystemType systemType) | ||
// Dump taken from LEGO 6290182 - 21980 - Electric, Motor WeDo 2.0 Medium which reports as 'LPF2-MMOTOR'. | ||
=> @" | ||
0B-00-43-02-01-01-01-00-00-01-00 | ||
05-00-43-02-02 | ||
11-00-44-02-00-00-4C-50-46-32-2D-4D-4D-4F-54-4F-52 | ||
0E-00-44-02-00-01-00-00-C8-C2-00-00-C8-42 | ||
0E-00-44-02-00-02-00-00-C8-C2-00-00-C8-42 | ||
0E-00-44-02-00-03-00-00-C8-C2-00-00-C8-42 | ||
0A-00-44-02-00-04-00-00-00-00 | ||
08-00-44-02-00-05-00-10 | ||
0A-00-44-02-00-80-01-00-04-00 | ||
".Trim().Split("\n").Select(s => BytesStringUtil.StringToData(s)); | ||
} |