Skip to content

Commit

Permalink
Merge pull request #33 from WildernessLabs/neopixelwing
Browse files Browse the repository at this point in the history
Neopixelwing + denugetize
  • Loading branch information
patridge authored Aug 11, 2023
2 parents 795ced1 + 4da1e04 commit 8a16ad9
Show file tree
Hide file tree
Showing 20 changed files with 348 additions and 27 deletions.
4 changes: 2 additions & 2 deletions Source/CharlieWing/Driver/CharlieWing.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
Expand All @@ -19,6 +19,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Is31fl3731" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\ICs.IOExpanders.Is31fl3731\Driver\ICs.IOExpanders.Is31fl3731.csproj" />
</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="0.*" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="0.*" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Libraries_and_Frameworks\Graphics.MicroGraphics\Driver\Graphics.MicroGraphics.csproj" />
<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 @@ -19,6 +19,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.Leds.Apa102" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Leds.Apa102\Driver\Leds.Apa102.csproj" />
</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="0.*" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="0.*" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Libraries_and_Frameworks\Graphics.MicroGraphics\Driver\Graphics.MicroGraphics.csproj" />
<ProjectReference Include="..\..\Driver\DotstarWing.csproj" />
</ItemGroup>
</Project>
75 changes: 75 additions & 0 deletions Source/FeatherWings.sln
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,26 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Displays.Ssd130x", "..\..\M
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Foundation.Core", "..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj", "{694940BF-DBE9-4650-AD84-6B69C5D6088A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NeoPixelWing", "NeoPixelWing", "{746A2619-CBF1-47E2-A5C2-06DD8FCBB439}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NeoPixelWing", "NeoPixelWing\Driver\NeoPixelWing.csproj", "{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Leds.Ws2812", "..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Leds.Ws2812\Driver\Leds.Ws2812.csproj", "{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{9D07325E-A887-47FF-9D2F-47070B1F3D57}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NeoPixelWing_Sample", "NeoPixelWing\Sample\NeoPixelWing_Sample\NeoPixelWing_Sample.csproj", "{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Core", "..\..\Meadow.Core\source\Meadow.Core\Meadow.Core.csproj", "{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Units", "..\..\Meadow.Units\Source\Meadow.Units\Meadow.Units.csproj", "{C91D75E5-D668-466A-A89D-970BE8228ECB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Contracts", "..\..\Meadow.Contracts\Source\Meadow.Contracts\Meadow.Contracts.csproj", "{0B716A9F-9461-4750-B68E-3739E473ACBA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Logging", "..\..\Meadow.Logging\Source\Meadow.Logging\lib\Meadow.Logging.csproj", "{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Displays.Led.FourteenSegment", "..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Displays.Led.FourteenSegment\Driver\Displays.Led.FourteenSegment.csproj", "{C84DE610-D39A-42DC-9153-F8884DE3869F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -275,6 +295,52 @@ Global
{694940BF-DBE9-4650-AD84-6B69C5D6088A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{694940BF-DBE9-4650-AD84-6B69C5D6088A}.Release|Any CPU.Build.0 = Release|Any CPU
{694940BF-DBE9-4650-AD84-6B69C5D6088A}.Release|Any CPU.Deploy.0 = Release|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Release|Any CPU.Build.0 = Release|Any CPU
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B}.Release|Any CPU.Deploy.0 = Release|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Release|Any CPU.Build.0 = Release|Any CPU
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34}.Release|Any CPU.Deploy.0 = Release|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Release|Any CPU.Build.0 = Release|Any CPU
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9}.Release|Any CPU.Deploy.0 = Release|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Release|Any CPU.Build.0 = Release|Any CPU
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617}.Release|Any CPU.Deploy.0 = Release|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Release|Any CPU.Build.0 = Release|Any CPU
{C91D75E5-D668-466A-A89D-970BE8228ECB}.Release|Any CPU.Deploy.0 = Release|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Release|Any CPU.Build.0 = Release|Any CPU
{0B716A9F-9461-4750-B68E-3739E473ACBA}.Release|Any CPU.Deploy.0 = Release|Any CPU
{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F}.Release|Any CPU.Build.0 = Release|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Release|Any CPU.Build.0 = Release|Any CPU
{C84DE610-D39A-42DC-9153-F8884DE3869F}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -317,6 +383,15 @@ Global
{B7159B77-A8B2-42B3-80B8-A62DEA13AB31} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{EF231FE5-3C87-469F-B5D9-065C32AA993D} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{694940BF-DBE9-4650-AD84-6B69C5D6088A} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{2A3BEBFE-65AC-4F11-BB7A-CD0EA2A1FD0B} = {746A2619-CBF1-47E2-A5C2-06DD8FCBB439}
{238778FF-05AC-4A4C-A9DE-C4A3CCA09A34} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{9D07325E-A887-47FF-9D2F-47070B1F3D57} = {746A2619-CBF1-47E2-A5C2-06DD8FCBB439}
{CE05E44F-1A05-4AE8-9C98-AE6B73A2AEE9} = {9D07325E-A887-47FF-9D2F-47070B1F3D57}
{D9938C19-2DA9-4AAE-87DF-19AACFAFD617} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{C91D75E5-D668-466A-A89D-970BE8228ECB} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{0B716A9F-9461-4750-B68E-3739E473ACBA} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{3BFD6004-9E9B-4EB0-B81F-FA1A7D52DB3F} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
{C84DE610-D39A-42DC-9153-F8884DE3869F} = {BB1A7E97-4559-459B-BDF8-4ED41758AB29}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {673CD5FD-E4C7-48D7-85EA-3CB6FAD87939}
Expand Down
6 changes: 4 additions & 2 deletions Source/GPSWing/Driver/GPSWing.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
Expand All @@ -17,6 +17,8 @@
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.Mt3339" Version="0.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Sensors.Gnss.Mt3339\Driver\Sensors.Gnss.Mt3339.csproj" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions Source/GPSWing/Samples/GPSWing_Sample/GPSWing_Sample.csproj
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="0.*" />
<ProjectReference Include="..\..\Driver\GPSWing.csproj" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Driver\GPSWing.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="0.*" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Driver\KeyboardWing.csproj" />
</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="0.*" />
<PackageReference Include="Meadow.Foundation.Graphics.MicroGraphics" Version="0.*" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Libraries_and_Frameworks\Graphics.MicroGraphics\Driver\Graphics.MicroGraphics.csproj" />
<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 @@ -19,6 +19,6 @@
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Pca9685" Version="0.*" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\ICs.IOExpanders.Pca9685\Driver\ICs.IOExpanders.Pca9685.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="0.*" />
<ProjectReference Include="..\..\..\..\..\Meadow.Core\source\implementations\f7\Meadow.F7\Meadow.F7.csproj" />
<ProjectReference Include="..\..\Driver\MotorWing.csproj" />
</ItemGroup>
</Project>
166 changes: 166 additions & 0 deletions Source/NeoPixelWing/Driver/NeoPixelWing.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.Buffers;
using Meadow.Foundation.Leds;
using Meadow.Hardware;
using System;

namespace Meadow.Foundation.FeatherWings
{
/// <summary>
/// Represents Adafruits NeoPixel FeatherWing
/// </summary>
public class NeoPixelWing : IGraphicsDisplay
{
/// <summary>
/// Color mode of display
/// </summary>
public ColorMode ColorMode => ColorMode.Format24bppGrb888;

/// <summary>
/// Width of display in pixels
/// </summary>
public int Width => 8;

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

/// <summary>
/// The pixel buffer that represents the offscreen buffer
/// Not implemented for this driver
/// </summary>
public IPixelBuffer PixelBuffer { get; protected set; }

/// <summary>
/// Color modes supported by the device
/// </summary>
public ColorMode SupportedColorModes => ColorMode.Format24bppRgb888;

/// <summary>
/// Returns Ws2812 instance
/// </summary>
public Ws2812 Leds { get; protected set; }

/// <summary>
/// Creates a NeoPixelWing driver instance
/// </summary>
/// <param name="spiBus">The SPI bus connected to the wing</param>
public NeoPixelWing(ISpiBus spiBus)
{
Leds = new Ws2812(spiBus, 32);
PixelBuffer = new BufferRgb888(8, 4);
}

/// <summary>
/// Clear the display buffer
/// </summary>
/// <param name="updateDisplay">Force a display update if true, false to clear the buffer</param>
public void Clear(bool updateDisplay = false)
{
PixelBuffer.Clear();

if(updateDisplay)
{
Show();
}
}

/// <summary>
/// Turn on an RGB LED with the specified color on (x,y) coordinates
/// </summary>
/// <param name="x">The x position in pixels 0 indexed from the left</param>
/// <param name="y">The y position in pixels 0 indexed from the top</param>
/// <param name="color">The color to draw normalized to black/off or white/on</param>
public void DrawPixel(int x, int y, Color color)
{
PixelBuffer.SetPixel(x, y, color);
}

/// <summary>
/// Turn on a LED on (x,y) coordinates
/// </summary>
/// <param name="x">The x position in pixels 0 indexed from the left</param>
/// <param name="y">The y position in pixels 0 indexed from the top</param>
/// <param name="colored">Led is on if true, off if false</param>
public void DrawPixel(int x, int y, bool colored)
{
DrawPixel(x, y, colored ? Color.White : Color.Black);
}

/// <summary>
/// Invert the color of the pixel at the given location
/// </summary>
/// <param name="x">The x position in pixels 0 indexed from the left</param>
/// <param name="y">The y position in pixels 0 indexed from the top</param>
public void InvertPixel(int x, int y)
{
PixelBuffer?.InvertPixel(x, y);
}

/// <summary>
/// Draw a buffer to the display
/// </summary>
/// <param name="x">The x position in pixels 0 indexed from the left</param>
/// <param name="y">The y position in pixels 0 indexed from the top</param>
/// <param name="displayBuffer">The display buffer to draw to the CharlieWing</param>
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
{
PixelBuffer.WriteBuffer(x, y, displayBuffer);
}

/// <summary>
/// Fill the display buffer to a normalized color
/// </summary>
/// <param name="fillColor">The clear color which will be normalized to black/off or white/on</param>
/// <param name="updateDisplay">Force a display update if true, false to clear the buffer</param>
public void Fill(Color fillColor, bool updateDisplay = false)
{
PixelBuffer.Fill(fillColor);

if(updateDisplay)
{ Show(); }
}

/// <summary>
/// Fill the display
/// </summary>
/// <param name="x">The x position in pixels 0 indexed from the left</param>
/// <param name="y">The y position in pixels 0 indexed from the top</param>
/// <param name="width">The width to fill in pixels</param>
/// <param name="height">The height to fill in pixels</param>
/// <param name="fillColor">The fillColor color which will be normalized to black/off or white/on</param>
public void Fill(int x, int y, int width, int height, Color fillColor)
{
PixelBuffer.Fill(height, x, y, width, fillColor);
}

/// <summary>
/// Update the display from the offscreen buffer
/// </summary>
public void Show()
{
for(int i = 0; i < PixelBuffer.Width; i++)
{
for(int j = 0; j < PixelBuffer.Height; j++)
{
Leds.SetLed(i + j * Width, PixelBuffer.GetPixel(i, j));
}
}

Leds.Show();
}

/// <summary>
/// Update a region of the display from the offscreen buffer
/// </summary>
/// <param name="left">The left bounding position in pixels</param>
/// <param name="top">The top bounding position in pixels</param>
/// <param name="right">The right bounding position in pixels</param>
/// <param name="bottom">The bottom bounding position in pixels</param>
public void Show(int left, int top, int right, int bottom)
{
Show();
}
}
}
25 changes: 25 additions & 0 deletions Source/NeoPixelWing/Driver/NeoPixelWing.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
<Authors>Wilderness Labs, Inc</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<OutputType>Library</OutputType>
<AssemblyName>NeoPixelWing</AssemblyName>
<Company>Wilderness Labs, Inc</Company>
<PackageProjectUrl>http://developer.wildernesslabs.co/Meadow/Meadow.Foundation/</PackageProjectUrl>
<PackageId>Meadow.Foundation.FeatherWings.NeoPixelWing</PackageId>
<RepositoryUrl>https://github.com/WildernessLabs/Meadow.Foundation.FeatherWings</RepositoryUrl>
<PackageTags>Meadow.Foundation,FeatherWing,NeoPixel,WS2812</PackageTags>
<Version>0.1.0</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Description>AdaFruit NeoPixel FeatherWing</Description>
</PropertyGroup>
<ItemGroup>
<None Include="..\..\icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Libraries_and_Frameworks\Graphics.MicroGraphics\Driver\Graphics.MicroGraphics.csproj" />
<ProjectReference Include="..\..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Peripherals\Leds.Ws2812\Driver\Leds.Ws2812.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 8a16ad9

Please sign in to comment.