Giter Site home page Giter Site logo

damiansuess / test.raspberrypinet Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 28 KB

Example of C# on a RaspberryPi and remote debugging

License: GNU General Public License v3.0

C# 100.00%
csharp raspberrypi raspberry-pi-3 xeno-innovations xenoinc remote-debugging

test.raspberrypinet's Introduction

Intro

This example uses C# for Raspberry Pi 3 and demonstrates remote debugging.

Fore note, all tests are performed using vs2019 (v16.4), RaspberryPi 3b v1.2 w/ Raspbian v9.

Linux - Launching the app

To launch your app using a clickable link on Desktop Linux.

We uploaded ours using WinSCP portable app to a new folder called TestApps under /home/pi/Desktop, and renamed the exe to test-pinet.exe to keep things simple.

Next, we'll create the clicking file. Open a console window and navigate to our new folder. Now, type sudo nano TestPi.sh and input the following content

#!/bin/bash
mono /home/pi/Desktop/TestApps/test-pinet.exe

Now give the TestPi.sh file executable rights

sudo chmod +x TestPi.sh

Give it a try by double clicking your file via the Desktop.

Raspberry Pi GPIO

.NET Core IoT

The C# snip below can be found at the .NET Core IoT samples.

Requires:

  • Red LED (1.8 - 2.2 Vf)
  • 100K resistor
  • GPIO pin 17 and GND.
int pin = 17;
GpioController controller = new GpioController();
controller.OpenPin(pin, PinMode.Output);

// Blink the LED
int lightTimeInMilliseconds = 1000;
int dimTimeInMilliseconds = 200;

while (true)
{
  Console.WriteLine($"Light for {lightTimeInMilliseconds}ms");
  controller.Write(pin, PinValue.High);

  Thread.Sleep(lightTimeInMilliseconds);
  Console.WriteLine($"Dim for {dimTimeInMilliseconds}ms");

  controller.Write(pin, PinValue.Low);
  Thread.Sleep(dimTimeInMilliseconds);
}

Resources

Raspberry Pi GPIO

Remote Debugging:

test.raspberrypinet's People

Contributors

damiansuess avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.