Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Release 1.12.0 #61

Merged
merged 1 commit into from
May 29, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Main Build
on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]

Expand All @@ -18,6 +17,7 @@ jobs:
uses: actions/checkout@v3
with:
path: Meadow.Foundation.FeatherWings
ref: main

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
Expand Down
45 changes: 28 additions & 17 deletions Source/CharlieWing/Driver/CharlieWing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ namespace Meadow.Foundation.FeatherWings
/// </summary>
public class CharlieWing : IPixelDisplay
{
private const int WidthInPixels = 15;
private const int HeightInPixels = 7;
private const int MaxFrames = 7;

/// <summary>
/// Is31fl3731 object to manage the leds
/// Is31fl3731 object to manage the LEDs
/// </summary>
protected readonly Is31fl3731 iS31FL3731;
protected readonly Is31fl3731 is31Fl3731;

/// <summary>
/// Color mode of display
Expand All @@ -23,12 +27,12 @@ public class CharlieWing : IPixelDisplay
/// <summary>
/// Width of display in pixels
/// </summary>
public int Width => 15;
public int Width => WidthInPixels;

/// <summary>
/// Height of display in pixels
/// </summary>
public int Height => 7;
public int Height => HeightInPixels;

/// <summary>
/// The Is31fl3731 active frame
Expand All @@ -53,13 +57,13 @@ public class CharlieWing : IPixelDisplay
/// <param name="address">The I2C address</param>
public CharlieWing(II2cBus i2cBus, byte address = (byte)Is31fl3731.Addresses.Default)
{
iS31FL3731 = new Is31fl3731(i2cBus, address);
iS31FL3731.Initialize();
is31Fl3731 = new Is31fl3731(i2cBus, address);
is31Fl3731.Initialize();

for (byte i = 0; i <= 7; i++)
for (byte i = 0; i <= MaxFrames; i++)
{
iS31FL3731.SetLedState(i, true);
iS31FL3731.Clear(i);
is31Fl3731.SetLedState(i, true);
is31Fl3731.Clear(i);
}
}

Expand All @@ -69,7 +73,7 @@ public CharlieWing(II2cBus i2cBus, byte address = (byte)Is31fl3731.Addresses.Def
/// <param name="updateDisplay">Force a display update if true, false to clear the buffer</param>
public void Clear(bool updateDisplay = false)
{
iS31FL3731.Clear(Frame);
is31Fl3731.Clear(Frame);
}

/// <summary>
Expand Down Expand Up @@ -102,6 +106,11 @@ public void DrawPixel(int x, int y, bool colored)
/// <param name="brightness">The led brightness from 0-255</param>
public void DrawPixel(int x, int y, byte brightness)
{
if (x < 0 || x >= WidthInPixels || y < 0 || y >= HeightInPixels)
{
throw new ArgumentOutOfRangeException($"Pixel coordinates ({x}, {y}) are out of bounds.");
}

if (x > 7)
{
x = 15 - x;
Expand All @@ -112,10 +121,10 @@ public void DrawPixel(int x, int y, byte brightness)
y = 7 - y;
}

//Swap
// Swap
(y, x) = (x, y);

iS31FL3731.SetLedPwm(Frame, (byte)(x + y * 16), brightness);
is31Fl3731.SetLedPwm(Frame, (byte)(x + y * 16), brightness);
}

/// <summary>
Expand All @@ -125,7 +134,9 @@ public void DrawPixel(int x, int y, byte brightness)
/// <param name="y">The y position in pixels 0 indexed from the top</param>
public void InvertPixel(int x, int y)
{
throw new NotImplementedException();
byte currentBrightness = is31Fl3731.GetLedPwm(Frame, (byte)(x + y * 16));
byte invertedBrightness = (byte)(255 - currentBrightness);
DrawPixel(x, y, invertedBrightness);
}

/// <summary>
Expand Down Expand Up @@ -185,7 +196,7 @@ public void Fill(int x, int y, int width, int height, Color fillColor)
/// </summary>
public void Show()
{
iS31FL3731.DisplayFrame(Frame);
is31Fl3731.DisplayFrame(Frame);
}

/// <summary>
Expand All @@ -201,12 +212,12 @@ public void Show(int left, int top, int right, int bottom)
}

/// <summary>
/// Update the display from a specific iS31FL3731 frame
/// Update the display from a specific Is31fl3731 frame
/// </summary>
/// <param name="frame">The frame to show (0-7)</param>
public void Show(byte frame)
{
iS31FL3731.DisplayFrame(frame);
is31Fl3731.DisplayFrame(frame);
}
}
}
}
2 changes: 1 addition & 1 deletion Source/CharlieWing/Driver/CharlieWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Is31fl3731" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Is31fl3731" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\CharlieWing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/DotstarWing/Driver/DotstarWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Leds.Apa102" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Leds.Apa102" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\DotstarWing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/GPSWing/Driver/GPSWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.Mt3339" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.Mt3339" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\GPSWing.csproj" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions Source/KeyboardWing/Driver/KeyboardWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Bbq10Keyboard" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Tsc2004" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Bbq10Keyboard" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Hid.Tsc2004" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\KeyboardWing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/LedMatrix8x16Wing/Driver/LedMatrix8x16Wing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Ht16k33" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Ht16k33" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\LedMatrix8x16Wing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/MotorWing/Driver/MotorWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Pca9685" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Pca9685" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\MotorWing.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/NeoPixelWing/Driver/NeoPixelWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Leds.Ws2812" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Leds.Ws2812" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\NeoPixelWing.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/NineDofImuWing/Driver/NineDofImuWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Lis3mdl" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Lsm6dsox" Version="1.11.0" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Motion.Lis3Mdl\Driver\Sensors.Motion.Lis3Mdl.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Motion.Lsm6Dsox\Driver\Sensors.Motion.Lsm6Dsox.csproj" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\NineDofImuWing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/OLED128x32Wing/Driver/OLED128x32Wing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Displays.Ssd130x" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Displays.Ssd130x" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\OLED128x32Wing.csproj" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion Source/OLED128x64Wing/Driver/OLED128x64Wing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Displays.Sh110x" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Displays.Sh110x" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\OLED128x64Wing.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/ServoWing/Driver/ServoWing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Pca9685" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.Servos.ServoCore" Version="1.11.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Pca9685" Version="1.12.0" />
<PackageReference Include="Meadow.Foundation.Servos.ServoCore" Version="1.12.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<AssemblyName>App</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="1.11.0" />
<PackageReference Include="Meadow.F7" Version="1.12.0" />
<ProjectReference Include="..\..\Driver\ServoWing.csproj" />
</ItemGroup>
</Project>
Loading