Jump to content
Sign in to follow this  
rogercarvalho

.NET IOT Libraries C#

Recommended Posts

Hi!

I have a Tinker Board.

SO: Tinker OS Debian.
I installed .Net Core 5 Arm32. (runtime + sdk)

It works fine!

 

I tried to make a simple Blinking Led app to start working with Tinker GPIO's.

CODE: (from https://docs.microsoft.com/pt-pt/dotnet/iot/tutorials/blink-led)

using System;
using System.Device.Gpio;
using System.Threading;

Console.WriteLine("Blinking LED. Press Ctrl+C to end.");
int pin = 18;
using var controller = new GpioController();
controller.OpenPin(pin, PinMode.Output);
bool ledOn = true;
while (true)
{
    controller.Write(pin, ((ledOn) ? PinValue.High : PinValue.Low));
    Thread.Sleep(1000);
    ledOn = !ledOn;
}

The app compiles with no problems.

But the link don't Blink. He keeps always "ON". It seams that cannot write to PIN...

Does anyone know if .Net Iot GPIO Library can communicate with Tinker GPIO ? There is some limitation ?

Thanks

 

 

Share this post


Link to post
Share on other sites
On 6/23/2021 at 2:45 PM, rogercarvalho said:

Hi!

I have a Tinker Board.

SO: Tinker OS Debian.
I installed .Net Core 5 Arm32. (runtime + sdk)

RockChip Soc: RK3288

It works fine!

 

I tried to make a simple Blinking Led app to start working with Tinker GPIO's.

CODE: (from https://docs.microsoft.com/pt-pt/dotnet/iot/tutorials/blink-led)


using System;
using System.Device.Gpio;
using System.Threading;

Console.WriteLine("Blinking LED. Press Ctrl+C to end.");
int pin = 18;
using var controller = new GpioController();
controller.OpenPin(pin, PinMode.Output);
bool ledOn = true;
while (true)
{
    controller.Write(pin, ((ledOn) ? PinValue.High : PinValue.Low));
    Thread.Sleep(1000);
    ledOn = !ledOn;
}

The app compiles with no problems.

But the link don't Blink. He keeps always "ON". It seams that cannot write to PIN...

Does anyone know if .Net Iot GPIO Library can communicate with Tinker GPIO ? There is some limitation ?

Thanks

 

 

Hi! I posted an issue on github and will try the susgestion:

"You can try this and refer to the datasheet for pin mapping
https://github.com/dotnet/iot/tree/main/src/devices/Gpio/Drivers/Rockchip"

 

Thanks to Zhang Yuexin.

 

 

Share this post


Link to post
Share on other sites

Hi! 

Solved! 

It was a problem related with the pin export at path "sys/class/gpio/export" 

 Its possible to use the System.Device.Gpio library to access asus tinker gpio pins. 

Best regards

Edited by rogercarvalho

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...