Skip to content
Open
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
28 changes: 28 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/RPi.SenseHat/RPi.SenseHat.Demo.Core/bin/Debug/netcoreapp2.2/RPi.SenseHat.Demo.Core.dll",
"args": [],
"cwd": "${workspaceFolder}/RPi.SenseHat/RPi.SenseHat.Demo.Core",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
,]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/RPi.SenseHat/RPi.SenseHat.Demo.Core/RPi.SenseHat.Demo.Core.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
A complete Windows IoT class library for the Raspberry Pi "Sense HAT" (C#)

The solution contains the following projects:</br>
*) Rpi.SenseHat</br>
*) RPi.SenseHat</br>
*) RPi.SenseHat.Demo.Core</br>
*) RPi.SenseHat.Demo.UWP</br>
*) RPi.SenseHat.Tools</br>
*) RTIMULibCS</br>

The Rpi.SenseHat is the main library. It contains a nice API to the Raspberry Sense HAT in C#.
The Rpi.SenseHat is dependent on the RTIMULibCS project, which is a library for managing the sensor readings from the Sense HAT. That project is currently a copy of another github repository until no NuGet of it is available.
The RPi.SenseHat is the main library. It contains a nice API to the Raspberry Sense HAT in C#.
The RPi.SenseHat is dependent on the RTIMULibCS project, which is a library for managing the sensor readings from the Sense HAT. That project is currently a copy of another github repository until no NuGet of it is available.

The RPi.SenseHat.Demo.* projects are applications that you can run on the Raspberry Pi. It doesn't utilize the regular UI, so there is no need to connect it to a monitor using the HDMI port.
The application comes with a number of demos.
Expand Down
19 changes: 0 additions & 19 deletions RPi.SenseHat/RPi.SenseHat.Demo.Core/Program.cs

This file was deleted.

39 changes: 0 additions & 39 deletions RPi.SenseHat/RPi.SenseHat.Demo.Core/UnosquareI2CDeviceFactory.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,8 +21,9 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat.Demo.Demos;
using Emmellsoft.IoT.RPi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat.Demo.Common;
using Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos;
using System;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo
Expand All @@ -49,11 +50,11 @@ public static SenseHatDemo GetDemo(ISenseHat senseHat, Action<string> setScreenT

//return new Compass(senseHat, setScreenText); // Note! You must calibrate the magnetic sensor by moving the Raspberry Pi device around in an 'eight' figure a few seconds at startup!

//return new SingleColorScrollText(senseHat, "Hello Raspberry Pi 3 Sense HAT!"); // Click on the joystick to change drawing mode!
return new SingleColorScrollText(senseHat, "Hello Raspberry Pi 3 Sense HAT!"); // Click on the joystick to change drawing mode!

//return new MultiColorScrollText(senseHat, "Hello Raspberry Pi 3 Sense HAT!");

return new SpriteAnimation(senseHat); // Use the joystick to move Mario. The middle button switches orientation and flipping of the drawing.
//return new SpriteAnimation(senseHat); // Use the joystick to move Mario. The middle button switches orientation and flipping of the drawing.

//return new GammaTest(senseHat); // Tries out different gamma settings for the LED display. Use the joystick to play around.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// the RPi.SenseHat Windows IoT class library for the Raspberry Pi
////////////////////////////////////////////////////////////////////////////

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
public class BinaryClock : SenseHatDemo
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,11 +21,12 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;
using Windows.Foundation;
using System.Drawing;
//using Windows.Foundation;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Note! You must calibrate the magnetic sensor by moving the Raspberry Pi device around in an 'eight' figure a few seconds at startup!
Expand Down Expand Up @@ -93,8 +94,9 @@ public override void Run()
private static Point GetPixelCoordinate(double angle)
{
return new Point(
Math.Round(Math.Cos(angle) * 3.5 + 3.5),
Math.Round(Math.Sin(angle) * 3.5 + 3.5));
//unsure if this can be done.
(int)Math.Round(Math.Cos(angle) * 3.5 + 3.5),
(int)Math.Round(Math.Sin(angle) * 3.5 + 3.5));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,10 +21,10 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Click on the joystick to change drawing mode!
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,11 +21,11 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;
using System.Linq;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Tries out different gamma settings for the LED display. Use the joystick to play around.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,11 +21,11 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using RTIMULibCS;
using System;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// The green blob is drawn to the center of the earth! If you hold it upside down it gets angry and turns red. :-O
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -23,10 +23,10 @@

//using Windows.UI;

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Use the joystick to move the pixel around.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,13 +21,13 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.Rpi.SenseHat.Fonts;
using Emmellsoft.IoT.Rpi.SenseHat.Fonts.MultiColor;
using Emmellsoft.IoT.RPi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat.Fonts;
using Emmellsoft.IoT.RPi.SenseHat.Fonts.MultiColor;
using System;
using System.Collections.Generic;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Multi-color scroll-text.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,12 +21,12 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;
using System.Diagnostics;
using System.Text;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
public sealed class ReadAllSensors : SenseHatDemo
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,11 +21,11 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat;
using System;
using System.Threading;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
public abstract class SenseHatDemo
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// This file is part of Rpi.SenseHat.Demo
// This file is part of RPi.SenseHat.Demo
//
// Copyright (c) 2019, Mattias Larsson
//
Expand All @@ -21,13 +21,13 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

using Emmellsoft.IoT.Rpi.SenseHat;
using Emmellsoft.IoT.Rpi.SenseHat.Fonts;
using Emmellsoft.IoT.Rpi.SenseHat.Fonts.SingleColor;
using Emmellsoft.IoT.RPi.SenseHat;
using Emmellsoft.IoT.RPi.SenseHat.Fonts;
using Emmellsoft.IoT.RPi.SenseHat.Fonts.SingleColor;
using System;
using System.Collections.Generic;

namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Demos
namespace Emmellsoft.IoT.RPi.SenseHat.Demo.Common.Demos
{
/// <summary>
/// Single color scroll-text.
Expand Down
Loading