Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update main for v2.0.1 #826

Merged
merged 8 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 84 additions & 9 deletions docs/Meadow/Meadow.Foundation/Peripherals/index.md

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions docs/Meadow/Release_Notes/v2/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ subtitle: Release Notes
* [Meadow.CLI](/Meadow/Meadow_Tools/Meadow_CLI/)
* [Meadow.OS](/Meadow/Getting_Started/Deploying_Meadow%2EOS/)

## v2.0.1

This is a Nuget only release (no new OS binaries) that fixes a few high priority driver bugs.

### Meadow.Foundation

* Bug fixes for `RS485` regression.
* Fixed `BME68x` reset.
* Improved `BME68x` calibration.
* Exposed 2nd temperature sensor on `ProjectLab`.
* Added StepperOnline `BLD510B` controller and `F55B150_24GL_30S` motor
* Rolled back System.IO.Ports references to 8.0.0

## v2.0.0.3

Meadow.OS v2.0 - **the reliability release**, is here, and while only an incremental upgrade from v1.15, it’s the culmination of nearly two years of work of stability fixes and polishing to make Meadow an ultra-reliable, full-featured, IoT OS that you can rely on for your critical applications. In setting out goals for Meadow.OS v2.0, we defined our reliability metrics as having three critical components:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
uid: Meadow.Foundation.Switches.ChromaTek.LatchingButton
slug: /docs/api/Meadow.Foundation.CompositeDevices/Meadow.Foundation.Switches.ChromaTek.LatchingButton
---

| LatchingButton | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/wildernesslabs/meadow.foundation.compositedevices/tree/main/Source/Switches.ChromaTek) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.Switches.ChromaTek/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.Switches.ChromaTek.svg?label=Meadow.Foundation.Switches.ChromaTek" alt="NuGet Gallery for Meadow.Foundation.Switches.ChromaTek" /></a> |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
uid: Meadow.Foundation.Switches.ChromaTek.MomentaryButton
slug: /docs/api/Meadow.Foundation.CompositeDevices/Meadow.Foundation.Switches.ChromaTek.MomentaryButton
---

| MomentaryButton | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/wildernesslabs/meadow.foundation.compositedevices/tree/main/Source/Switches.ChromaTek) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.Switches.ChromaTek/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.Switches.ChromaTek.svg?label=Meadow.Foundation.Switches.ChromaTek" alt="NuGet Gallery for Meadow.Foundation.Switches.ChromaTek" /></a> |

Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
uid: Meadow.Foundation.FeatherWings.CanBusWing
slug: /docs/api/Meadow.Foundation.FeatherWings/Meadow.Foundation.FeatherWings.CanBusWing
---

| CanBusWing | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/WildernessLabs/Meadow.Foundation.FeatherWings/tree/main/Source/CanBusWing) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.FeatherWings.CanBusWing/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.FeatherWings.CanBusWing.svg?label=Meadow.Foundation.FeatherWings.CanBusWing" alt="NuGet Gallery for Meadow.Foundation.FeatherWings.CanBusWing" /></a> |
### Code Example

```csharp
private CanBusWing wing;

public override Task Initialize()
{
Console.WriteLine("Initialize...");

wing = new CanBusWing(Device);

return Task.CompletedTask;
}

public override async Task Run()
{
var bus = wing.CreateCanBus(CanBitrate.Can_250kbps);

Console.WriteLine($"Listening for CAN data...");

var tick = 0;

while (true)
{
var frame = bus.ReadFrame();
if (frame != null)
{
if (frame is StandardDataFrame sdf)
{
Console.WriteLine($"Standard Frame: {sdf.ID:X3} {BitConverter.ToString(sdf.Payload)}");
}
else if (frame is ExtendedDataFrame edf)
{
Console.WriteLine($"Extended Frame: {edf.ID:X8} {BitConverter.ToString(edf.Payload)}");
}
}
else
{
await Task.Delay(100);
}

if (tick++ % 50 == 0)
{
Console.WriteLine($"Sending Standard Frame...");

bus.WriteFrame(new StandardDataFrame
{
ID = 0x700,
Payload = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, (byte)(tick & 0xff) }
});
}
}
}

```

[Sample project(s) available on GitHub](https://github.com/WildernessLabs/Meadow.Foundation.FeatherWings/tree/main/Source/CanBusWing/Samples/CanBusWing_Sample)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,23 @@ public override Task Initialize()

var i2CBus = Device.CreateI2cBus(I2cBusSpeed.FastPlus);
motorWing = new MotorWing(i2CBus, new Frequency(100, Frequency.UnitType.Hertz), 0x61);
motorWing.Initialize();

return Task.CompletedTask;
}

public override async Task Run()
{
//Get DC motor 1
var dcMotor1 = motorWing.GetMotor(1);
var dcMotor1 = motorWing.GetMotor(MotorWing.DCMotorIndex.Motor1);

//Get DC motor 2
var dcMotor2 = motorWing.GetMotor(2);
var dcMotor2 = motorWing.GetMotor(MotorWing.DCMotorIndex.Motor2);

//Get Stepper motor number 2
var stepper = motorWing.GetStepper(2, 200);
var stepper = motorWing.GetStepper(MotorWing.StepperMotorIndex.Motor2, 200);

dcMotor1.Run(Commmand.FORWARD);
dcMotor2.Run(Commmand.BACKWARD);
dcMotor1.Run(MotorWing.Direction.Forward);
dcMotor2.Run(MotorWing.Direction.Reverse);

while (true)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ slug: >-

```csharp
ServoWing servoWing;
Servo servo;
AngularServo servo;

public override Task Initialize()
{
Console.WriteLine("Initializng ...");

servoWing = new ServoWing(Device.CreateI2cBus(I2cBusSpeed.FastPlus));

servo = servoWing.GetServo(0, NamedServoConfigs.SG90);
servo = servoWing.GetServo(0,
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MinimumAngle, new TimePeriod(NamedServoConfigs.SG90.MinimumPulseDuration, TimePeriod.UnitType.Milliseconds)),
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MaximumAngle, new TimePeriod(NamedServoConfigs.SG90.MaximumPulseDuration, TimePeriod.UnitType.Milliseconds)));

return Task.CompletedTask;
}
Expand All @@ -33,19 +35,19 @@ public override async Task Run()
while (true)
{
Console.WriteLine("0");
await servo.RotateTo(new Angle(0, AU.Degrees));
servo.RotateTo(new Angle(0, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("45");
await servo.RotateTo(new Angle(45, AU.Degrees));
servo.RotateTo(new Angle(45, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("90");
await servo.RotateTo(new Angle(90, AU.Degrees));
servo.RotateTo(new Angle(90, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("135");
await servo.RotateTo(new Angle(135, AU.Degrees));
servo.RotateTo(new Angle(135, AU.Degrees));
await Task.Delay(1000);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ public override Task Initialize()

public override async Task Run()
{
await servo.RotateTo(new Angle(servo.Config.MinimumAngle.Degrees, AU.Degrees));
servo.RotateTo(servo.MaximumAngle);

while (true)
{
for (int i = 0; i <= servo.Config.MaximumAngle.Degrees; i++)
for (int i = 0; i <= servo.MaximumAngle.Degrees; i++)
{
await servo.RotateTo(new Angle(i, AU.Degrees));
servo.RotateTo(new Angle(i, AU.Degrees));
Resolver.Log.Info($"Rotating to {i}");
await Task.Delay(40);
}

await Task.Delay(2000);

for (int i = 180; i >= servo.Config.MinimumAngle.Degrees; i--)
for (int i = 180; i >= servo.MinimumAngle.Degrees; i--)
{
await servo.RotateTo(new Angle(i, AU.Degrees));
servo.RotateTo(new Angle(i, AU.Degrees));
Resolver.Log.Info($"Rotating to {i}");
await Task.Delay(40);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
uid: Meadow.Foundation.mikroBUS.CThermo13
slug: /docs/api/Meadow.Foundation.mikroBUS/Meadow.Foundation.mikroBUS.CThermo13
---

| CThermo13 | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/WildernessLabs/Meadow.Foundation.MikroBus/tree/main/Source/CThermo13) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.mikroBUS.Sensors.Atmospheric.CThermo13/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.mikroBUS.Sensors.Atmospheric.CThermo13.svg?label=Meadow.Foundation.mikroBUS.Sensors.Atmospheric.CThermo13" alt="NuGet Gallery for Meadow.Foundation.mikroBUS.Sensors.Atmospheric.CThermo13" /></a> |
### Code Example

```csharp
private CThermo13 _thermo;

public MeadowApp()
{
Console.WriteLine("Initializing...");

_thermo = new CThermo13(Device.CreateI2cBus());

var consumer = CThermo13.CreateObserver(
handler: result =>
{
Console.WriteLine($"Observer: Temp changed by threshold; new temp: {result.New.Celsius:N2}C, old: {result.Old?.Celsius:N2}C");
},
filter: result =>
{
if (result.Old is { } old)
{
return (result.New - old).Abs().Celsius > 0.5;
}
return false;
}
);
_thermo.Subscribe(consumer);

_thermo.Updated += (sender, result) =>
{
Console.WriteLine($" Temperature: {result.New.Celsius:N2}C");
};

ReadConditions().Wait();

_thermo.StartUpdating(TimeSpan.FromSeconds(1));
}

private async Task ReadConditions()
{
var conditions = await _thermo.Read();
Console.WriteLine("Initial Readings:");
Console.WriteLine($" Temperature: {conditions.Celsius:N2}C");
}

```

[Sample project(s) available on GitHub](https://github.com/WildernessLabs/Meadow.Foundation.MikroBus/tree/main/Source/CThermo13/Sample/CThermo13_Sample)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
uid: Displays.ePaperWaveShare.Drivers.Epd2in15g
slug: /docs/api/Meadow.Foundation/Displays.ePaperWaveShare.Drivers.Epd2in15g
---

| Epd2in15g | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Peripherals/Displays.ePaperWaveShare) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.Displays.ePaperWaveShare/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.Displays.ePaperWaveShare.svg?label=Meadow.Foundation.Displays.ePaperWaveShare" alt="NuGet Gallery for Meadow.Foundation.Displays.ePaperWaveShare" /></a> |
### Code Example

```csharp
MicroGraphics graphics;

public override Task Initialize()
{
Resolver.Log.Info("Initialize ...");

var display = new Epd2in15g(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.A04,
dcPin: Device.Pins.A03,
resetPin: Device.Pins.A02,
busyPin: Device.Pins.A01);

graphics = new MicroGraphics(display);

return Task.CompletedTask;
}

public override Task Run()
{
Resolver.Log.Info("Run");

graphics.Clear();

graphics.CurrentFont = new Font12x16();
graphics.DrawText(0, 0, "Meadow F7", Color.Black, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 50, "Yellow", Color.Yellow, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 100, "Red", Color.Red, scaleFactor: ScaleFactor.X2);

graphics.Show();

Resolver.Log.Info("Run complete");

return Task.CompletedTask;
}

```

[Sample project(s) available on GitHub](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Peripherals/Displays.ePaperWaveShare/Samples/Epd2in15g_Sample)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
uid: Meadow.Foundation.Batteries.Voltaic.V10x
slug: /docs/api/Meadow.Foundation/Meadow.Foundation.Batteries.Voltaic.V10x
---

| V10x | |
|--------|--------|
| Status | <img src="https://img.shields.io/badge/Working-brightgreen" style={{ width: "auto", height: "-webkit-fill-available" }} alt="Status badge: working" /> |
| Source code | [GitHub](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Peripherals/Batteries.Voltaic.V10x) |
| Datasheet(s) | [GitHub](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Peripherals/Batteries.Voltaic.V10x/Datasheet) |
| NuGet package | <a href="https://www.nuget.org/packages/Meadow.Foundation.Batteries.Voltaic.V10x/" target="_blank"><img src="https://img.shields.io/nuget/v/Meadow.Foundation.Batteries.Voltaic.V10x.svg?label=Meadow.Foundation.Batteries.Voltaic.V10x" alt="NuGet Gallery for Meadow.Foundation.Batteries.Voltaic.V10x" /></a> |
### Code Example

```csharp
public override async Task Run()
{
Resolver.Log.Info("Run...");

using (var port = new SerialPortShim("COM5", V10x.DefaultBaudRate, Parity.None, 8, StopBits.One))
{
port.ReadTimeout = TimeSpan.FromSeconds(15);
port.Open();

var client = new ModbusRtuClient(port);
var controller = new V10x(client);

controller.CommTimeout += (s, e) => Debug.WriteLine("Read Timeout");
controller.CommError += (s, e) => Debug.WriteLine($"Error: {e.Message}");

controller.StartPolling();

var i = 0;

while (true)
{
await Task.Delay(2000);
Debug.WriteLine($"---------------");
Debug.WriteLine($"Battery voltage: {controller.BatteryVoltage.Volts:N2} V");
Debug.WriteLine($"Input voltage: {controller.InputVoltage.Volts:N2} V");
Debug.WriteLine($"Input current: {controller.InputCurrent.Amps:N2} A");
Debug.WriteLine($"Load voltage: {controller.LoadVoltage.Volts:N2} V");
Debug.WriteLine($"Load current: {controller.LoadCurrent.Amps:N2} A");
Debug.WriteLine($"Environ temp: {controller.EnvironmentTemp.Fahrenheit:N2} F");
Debug.WriteLine($"Controller temp: {controller.ControllerTemp.Fahrenheit:N2} F");

controller.BatteryOutput = (i++ % 2 == 0);
}
}
}

```

[Sample project(s) available on GitHub](https://github.com/WildernessLabs/Meadow.Foundation/tree/main/Source/Meadow.Foundation.Peripherals/Batteries.Voltaic.V10x/Samples/V10x_Sample)

Expand Down
Loading
Loading