Questions tagged [c#]

For questions pertaining to compiling C# programs on the Raspberry Pi.

C# is general purpose programming language derived from C and akin to Java, originally propagated by Microsoft but with an open source implementation (mono) available for GNU/Linux distributions like Raspbian as well.

Note the syntax highlighting used for C# questions is actually lang-java because google prettify does not have direct support for C#.

84 questions
20
votes
5 answers

How do you get C# onto your raspberry pi?

I would like to start learning C# and really want to code in it on my raspberry pi. However, I can't find a way to get C# onto my pi. Does anyone know how to do this? I have the Raspberry pi 2 model B. Thanks for your help.
John Quincy
  • 313
  • 1
  • 2
  • 6
6
votes
1 answer

SPI access via C# .NET Core console app

I do not have much experience with C# or Linux/Raspbian so would like some advice/guidance please. Basically I need to write a C# .NET Core console app which will run on a Raspberry Pi Compute 3 module (running Raspbian) allowing text to be written…
fox333
  • 61
  • 2
5
votes
2 answers

Pi with C# instead of Python

I am very new to Pi but have a RPi 3 running windows 10 I.O.T. core. Can I do c# on it instead of Python? I am interested in some I.O.T. project using Pi but they use C instead of python which is more commonly used on the RPI. Just wondering this is…
user1254579
  • 153
  • 1
  • 4
5
votes
4 answers

Setting Pull Up/Pull Down mode doesn't work (mostly)

I can't seem to set the pull-up resistor mode on the PI4 with most methods I try. I have tried: C# (the new System.Device.Gpio interface), WiringPi (using a C# abstraction), and wiringPi command line interface. Setting the pin mode to input or…
PMF
  • 906
  • 7
  • 14
4
votes
1 answer

Play sound with mono c# doesn't work on Raspbian

I try to play a sound from a Raspberry Pi 3 with Raspbian installed. I have mono installed. I tested it on Windows, and it runs well. But when running it on Raspbian. I don't get any error message and no sound either. public void PlaySound() { …
Sven Borden
  • 171
  • 4
3
votes
1 answer

TMP36GZ/DS1822 Temperature Sensors not outputting any values

I am trying to connect a temperature sensor to my Raspberry Pi using this tutorial for Windows IoT Core. I have connected all of the wires and MCP3002 correctly, but I cannot read in any values from my sensor when the app is deployed and run. The…
Andre
  • 133
  • 5
3
votes
0 answers

Controlling Stepper Motor with Raspberry Pi 3 and Win 10 IoT

I am working on a project which requires operating bipolar stepper motor with Raspberry Pi 3 and Windows 10 IoT core. I am writing the program in C#. Currently, I am getting the pulses on the motor and it is producing little movement, but I am not…
3
votes
2 answers

How do I programmatically retrieve a unique identifier for a Raspberry Pi using C#/Windows IoT?

A question came up recently which requires the generation of a unique identifier for the Pi using Win-Iot/C#. My first thought was to use a MAC code, but the approach that I've found at embedded101.com looks pretty cumbersome. Is there a neat…
goobering
  • 10,750
  • 4
  • 40
  • 64
3
votes
0 answers

I2C windows iot can't connect

I'm trying to communicate between a Raspberry Pi 3 running Windows 10 IOT (build 14376 insiders) and a T-REX Manual here using I2C protocol. The thing is that it always crashes, so after some debugging I've found that it looks like it doesn't…
Sven Borden
  • 171
  • 4
3
votes
0 answers

Raspberry Attempted to read or write protected memory. This is often an indication that other memory is corrupt

I have the following code, and the StopWatch object, when I try to restart it, it throws this exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt The code is as follows: public sealed…
gina
  • 29
  • 1
  • 8
3
votes
3 answers

Application to know how long my batteries will last?

I am new in the raspberry world and learning to program it with C# on Windows IOT Core. Right now I am working with it connected to the power supply. However I would like to develop an application to know how long the battery will last, a simple…
Luis Valencia
  • 93
  • 2
  • 10
3
votes
1 answer

Pi2 does not power up. Is there anything I can do?

I finally started putting an auto-plant-watering system together, trying to develop the entire system using Win10 IoT, VS 2015, and c#. I'm at the very beginning stages of development but I did get the moisture sensor reading and LEDs lighting up…
lamarant
  • 221
  • 2
  • 4
3
votes
0 answers

Coin acceptor misbehave when connected on raspberry pi

I have a Bill note acceptor and a Coin acceptor, and I have wrote a program in C# to communicate with these two machines, and it worked perfectly on windows, after that I migrated this application to raspbian using mono. the Bill acceptor still…
amm965
  • 131
  • 3
2
votes
0 answers

GPIO Library in Windows Visual Studio 2012 (C#)

I am developing an application in Visual Studio 2012 (C#) + Raspberry Pi 3 and I have some problems in accessing the GPIO of Raspberry Pi 3. Does anyone recommend any library that access GPIO for Windows? In Linux, I use WiringPi, but I have not…
Tuxpilgrim
  • 221
  • 2
  • 6
2
votes
1 answer

Windows 10 core with Raspberry Pi

I amusing C# UWP and i am storing sensor data to a database. What I would like to do is send the Sensor name instead of the GPIO Number. So on pin_valuechanged() I like to assign the pinNumber a name. I can have this preconfigured set of pins and…
1
2 3 4 5 6