You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Star0 (0)You must be signed in to star a repository
About
Raspberry Pi platform library for .NET - VCIO system info, LEGO Build HAT motors and sensors, framebuffer drawing, Blinkt LEDs, plus GPIO/I2C/Sense HAT examples
usingvarhat=newBuildHatController();hat.Open();awaithat.WaitForDeviceAsync(0,TimeSpan.FromSeconds(10));// Motorvarmotor=hat.GetMotor(0);awaitmotor.RunForDegreesAsync(360,30);awaitmotor.RunToAbsolutePositionAsync(0,50,BuildHatDirection.Shortest,BuildHatStopMode.Hold);// Motor pairvarpair=hat.GetMotorPair(0,2);awaitpair.RunForDegreesAsync(360,30,-30);// Color & Distance Sensorvarsensor=hat.GetColorDistanceSensor(3);Console.WriteLine($"color={awaitsensor.ReadColorAsync()}, distance={awaitsensor.ReadDistanceAsync()}");
Support
Devices
Tested
Motor
Technic Large / XL Motor, Technic Medium / Large Angular Motor, Small Angular Motor, Medium Linear Motor
✓
PassiveMotor
System Medium / Train / Turntable Motor, Technic Large / XL Motor (passive)
-
Light
Light
-
ColorDistanceSensor
Color & Distance Sensor
✓
ColorSensor
Color Sensor
-
DistanceSensor
Distance Sensor
-
ForceSensor
Force Sensor
-
LightMatrix
3x3 Color Light Matrix
-
TiltSensor
WeDo 2.0 Tilt Sensor
-
MotionSensor
WeDo 2.0 Motion Sensor
-
Generic (BuildHatPort)
Other active devices
-
Unsupported
Button and other passive devices
-
Select / SelectMode / SelectCombi stream the data into Port.State.Values, and reads of the selected mode return the latest value immediately
Enable the serial port and disable the serial login shell with raspi-config
Events are raised on the receive thread
The firmware of python-build-hat (MIT, Firmware/LICENSE.txt) is embedded and uploaded when needed
Raspberry Pi platform library for .NET - VCIO system info, LEGO Build HAT motors and sensors, framebuffer drawing, Blinkt LEDs, plus GPIO/I2C/Sense HAT examples