![]() |
VOOZH | about |
dotnet add package DNETCoreGPIO --version 1.3.3
NuGet\Install-Package DNETCoreGPIO -Version 1.3.3
<PackageReference Include="DNETCoreGPIO" Version="1.3.3" />
<PackageVersion Include="DNETCoreGPIO" Version="1.3.3" />Directory.Packages.props
<PackageReference Include="DNETCoreGPIO" />Project file
paket add DNETCoreGPIO --version 1.3.3
#r "nuget: DNETCoreGPIO, 1.3.3"
#:package DNETCoreGPIO@1.3.3
#addin nuget:?package=DNETCoreGPIO&version=1.3.3Install as a Cake Addin
#tool nuget:?package=DNETCoreGPIO&version=1.3.3Install as a Cake Tool
A .NET library then can be used directly with a .NET console app app to run on the RPi. Works with both Raspian (Debian).
Uses System.Devices.GPIO and Iot.Device.Bindings Nuget packages.
Create a .NET Console app:
Run dotnet new console
Add the library as a Nuget package
Run dotnet add package DNETCoreGPIO --version 1.y.x
NB: Use the current version, in place of 1.y.x,check at https://www.nuget.org/packages/DNETCoreGPIO/
Can use * to get latest.
Change the 7th line in Program.cs as below:
using System.Threading.Tasks;
namespace ConsoleGPIOApp
{
class Program
{
static aync Task Main(string[] args)
{
await DotNetCoreCoreGPIO.Program.Main(args);
}
}
}
NB: if using .NET6.0 Console template you only need a one line file for Program.cs:
DotNetCoreCoreGPIO.Program.Main(args);
Build and run the app with the required first parameter.(See below)
***Based upon samples in the GitHUb Repository: dotnet/iot
New Feature: Can change GPIO mappings as second parameter. eg "17,4,26,22,27,17,19", which is the current settings.
Which map to led,button,dht22,motoren, motorfwd,motorrev,relay respectively.
Run the app with one of the following as the first parameter Note possible 2nd parameter for GPIO mappings as above.
Whilst the above run continously or until stopped the following only do a single pass.
These are used by TRIGGERcmd
11/12. Relay On/Off
Temperature and Humidity with DHT22 sensor using 1-Wire.
Get single value and write to /tmp/temperature.txt on RPi
See TRIGGERcmd.GetTempDHTxx1Wire()
Temperature Pressure and Humidity with BME280.
Get single values and write to /tmp/temperature.txt, on RPi
Set LED as per 1.
Clear LED ditto
Toggle LED ditto
The following control the motor as in 6 but as separate commands.
The following run continously:
30. (2Do) Start sending DHT22 1-Wire Telemetry to Azure IoT Hub. Requires a period (default 10 sec) between readings and DeviceConnectionString.
31. Start sending BME280 Telemetry to Azure IoT Hub. Requires a period (default 10 sec) between readings and DeviceConnectionString.
PS: Can toggle a soleniod with the LED.
NB: Look at circuit diagrams here on GitHub
Pins:
As above
See circuit diagram under Circuits.
Active pin is is GPIO26. I'm using a 10K pullup to that.
Some conversions fail, which output as dots. Doesn't work on IOT-Core.
See circuit diagram in Circuits folder, left part. <br>Pins (L293D pins in brackets):
See circuit diagram in Circuits folder, right part. <br>Pins (L293D pins in brackets):
More on My Blog
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.3.3 | 809 | 3/30/2022 | |
| 1.3.2 | 587 | 3/29/2022 | |
| 1.3.1 | 622 | 3/27/2022 | |
| 1.3.0 | 595 | 3/26/2022 | |
| 1.2.2 | 618 | 3/20/2022 | |
| 1.2.1 | 593 | 3/20/2022 | |
| 1.2.0 | 736 | 3/20/2022 | 1.2.0 is deprecated. |
| 1.1.2 | 735 | 3/20/2022 | 1.1.2 is deprecated. |
| 1.1.1 | 698 | 3/19/2022 | 1.1.1 is deprecated. |
| 1.1.0 | 691 | 3/19/2022 | 1.1.0 is deprecated. |
| 1.0.9 | 721 | 3/19/2022 | 1.0.9 is deprecated. |
| 1.0.8 | 629 | 3/11/2022 | |
| 1.0.7 | 604 | 3/11/2022 | |
| 1.0.6 | 616 | 3/9/2022 | |
| 1.0.5 | 613 | 3/9/2022 | |
| 1.0.4 | 606 | 3/1/2022 | |
| 1.0.3 | 568 | 2/28/2022 | |
| 1.0.1 | 594 | 2/28/2022 |
Fixing some MORE async issues.