Skip to content

Commit 9bb4714

Browse files
authored
Add TechnicLargeAngularMotor (Grey) (#108)
- Add TechnicLargeAngularMotor - Updated README #75 non-breaking
1 parent e26467c commit 9bb4714

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ DI Container Elements
264264
- [X] Train Motor (88011)
265265
- [X] Technic Large Motor (88013)
266266
- [X] Technic XLarge Motor (88014)
267-
- [ ] Technic Angular Motor (depend on availability of hardware / contributions)
267+
- [ ] Technic Medium Angular Motor (Spike)
268+
- [ ] Technic Medium Angular Motor (Grey)
269+
- [ ] Technic Large Angular Motor (Spike)
270+
- [X] Technic Large Angular Motor (Grey)
268271
- .. other devices depend on availability of hardware / contributions
269272
- Protocol
270273
- [X] Message Encoding (98% [spec coverage](docs/specification/coverage.md))

src/SharpBrick.PoweredUp/Devices/DeviceFactory.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public Type GetTypeFromDeviceType(DeviceType deviceType)
3636
DeviceType.SystemTrainMotor => typeof(SystemTrainMotor),
3737
DeviceType.TechnicLargeLinearMotor => typeof(TechnicLargeLinearMotor),
3838
DeviceType.TechnicXLargeLinearMotor => typeof(TechnicXLargeLinearMotor),
39+
DeviceType.TechnicLargeAngularMotorGrey => typeof(TechnicLargeAngularMotorGrey),
3940
DeviceType.TechnicMediumHubGestureSensor => typeof(TechnicMediumHubGestureSensor),
4041
DeviceType.TechnicMediumHubAccelerometer => typeof(TechnicMediumHubAccelerometer),
4142
DeviceType.TechnicMediumHubGyroSensor => typeof(TechnicMediumHubGyroSensor),
@@ -54,6 +55,7 @@ public static DeviceType GetDeviceTypeFromType(Type type)
5455
nameof(SystemTrainMotor) => DeviceType.SystemTrainMotor,
5556
nameof(TechnicLargeLinearMotor) => DeviceType.TechnicLargeLinearMotor,
5657
nameof(TechnicXLargeLinearMotor) => DeviceType.TechnicXLargeLinearMotor,
58+
nameof(TechnicLargeAngularMotorGrey) => DeviceType.TechnicLargeAngularMotorGrey,
5759
nameof(TechnicMediumHubGestureSensor) => DeviceType.TechnicMediumHubGestureSensor,
5860
nameof(TechnicMediumHubAccelerometer) => DeviceType.TechnicMediumHubAccelerometer,
5961
nameof(TechnicMediumHubGyroSensor) => DeviceType.TechnicMediumHubGyroSensor,
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using SharpBrick.PoweredUp.Protocol;
5+
using SharpBrick.PoweredUp.Utils;
6+
7+
namespace SharpBrick.PoweredUp
8+
{
9+
public class TechnicLargeAngularMotorGrey : AbsoluteMotor, IPoweredUpDevice
10+
{
11+
public TechnicLargeAngularMotorGrey()
12+
: base()
13+
{ }
14+
public TechnicLargeAngularMotorGrey(ILegoWirelessProtocol protocol, byte hubId, byte portId)
15+
: base(protocol, hubId, portId)
16+
{ }
17+
18+
public IEnumerable<byte[]> GetStaticPortInfoMessages(Version softwareVersion, Version hardwareVersion, SystemType systemType)
19+
=> @"
20+
0B-00-43-00-01-0F-06-0E-00-0F-00
21+
07-00-43-00-02-0E-00
22+
11-00-44-00-00-00-50-4F-57-45-52-00-00-00-00-00-00
23+
0E-00-44-00-00-01-00-00-C8-C2-00-00-C8-42
24+
0E-00-44-00-00-02-00-00-C8-C2-00-00-C8-42
25+
0E-00-44-00-00-03-00-00-C8-C2-00-00-C8-42
26+
0A-00-44-00-00-04-50-43-54-00
27+
08-00-44-00-00-05-00-50
28+
0A-00-44-00-00-80-01-00-04-00
29+
11-00-44-00-01-00-53-50-45-45-44-00-00-00-00-00-00
30+
0E-00-44-00-01-01-00-00-C8-C2-00-00-C8-42
31+
0E-00-44-00-01-02-00-00-C8-C2-00-00-C8-42
32+
0E-00-44-00-01-03-00-00-C8-C2-00-00-C8-42
33+
0A-00-44-00-01-04-50-43-54-00
34+
08-00-44-00-01-05-30-70
35+
0A-00-44-00-01-80-01-00-04-00
36+
11-00-44-00-02-00-50-4F-53-00-00-00-00-00-00-00-00
37+
0E-00-44-00-02-01-00-00-B4-C3-00-00-B4-43
38+
0E-00-44-00-02-02-00-00-C8-C2-00-00-C8-42
39+
0E-00-44-00-02-03-00-00-B4-C3-00-00-B4-43
40+
0A-00-44-00-02-04-44-45-47-00
41+
08-00-44-00-02-05-28-68
42+
0A-00-44-00-02-80-01-02-0B-00
43+
11-00-44-00-03-00-41-50-4F-53-00-00-00-00-00-00-00
44+
0E-00-44-00-03-01-00-00-34-C3-00-00-33-43
45+
0E-00-44-00-03-02-00-00-48-C3-00-00-48-43
46+
0E-00-44-00-03-03-00-00-34-C3-00-00-33-43
47+
0A-00-44-00-03-04-44-45-47-00
48+
08-00-44-00-03-05-32-72
49+
0A-00-44-00-03-80-01-01-03-00
50+
11-00-44-00-04-00-43-41-4C-49-42-00-00-00-00-00-00
51+
0E-00-44-00-04-01-00-00-00-00-00-00-61-45
52+
0E-00-44-00-04-02-00-00-00-00-00-00-C8-42
53+
0E-00-44-00-04-03-00-00-00-00-00-00-61-45
54+
0A-00-44-00-04-04-43-41-4C-00
55+
08-00-44-00-04-05-00-00
56+
0A-00-44-00-04-80-02-01-05-00
57+
11-00-44-00-05-00-53-54-41-54-53-00-00-00-00-00-00
58+
0E-00-44-00-05-01-00-00-00-00-00-FF-7F-47
59+
0E-00-44-00-05-02-00-00-00-00-00-00-C8-42
60+
0E-00-44-00-05-03-00-00-00-00-00-FF-7F-47
61+
0A-00-44-00-05-04-4D-49-4E-00
62+
08-00-44-00-05-05-00-00
63+
0A-00-44-00-05-80-0E-01-05-00
64+
".Trim().Split("\n").Select(s => BytesStringUtil.StringToData(s));
65+
}
66+
}

src/SharpBrick.PoweredUp/Enums/DeviceType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@ public enum DeviceType : ushort
3737
TechnicColorSensor = 0x003D, // UNSPECED, TECHNIC_COLOR_SENSOR (Spike Prime)
3838
TechnicDistanceSensor = 0x003E, // UNSPECED, TECHNIC_DISTANCE_SENSOR (Spike Prime)
3939
TechnicForceSensor = 0x003F, // UNSPECED, TECHNIC_FORCE_SENSOR (Spike Prime)
40+
TechnicMediumAngularMotorGrey = 0x004B, // UNSPECED, TECHNIC_MEDIUM_ANGULAR_MOTOR_GREY (Control+)
41+
TechnicLargeAngularMotorGrey = 0x004C, // UNSPECED, TECHNIC_LARGE_ANGULAR_MOTOR_GREY (Control+)
4042
}
4143
}

0 commit comments

Comments
 (0)