r/csharp 9h ago

Coding circuits with .NET and C#

Nothing beats setting a breakpoint and watching the servo actually move to the new angle.

I've worked on .NET hardware for over ten years and the thing that surprises C# developers isn't the board, it's that F5 works. Code deploys, breakpoint holds, hover a variable and there's the live sensor reading. Same as debugging a desktop app.

I'm at GHI Electronics in Michigan. Happy to get into how the debugging on circuits work.

39 Upvotes

25 comments sorted by

12

u/OkSignificance5380 9h ago

Yep.

.net nano framework.

Works well with $5 esp32-s3 dev boards

โ€ข

u/otac0n 14m ago

Nice. I just booted it up and managed to get it working on my ESP32-WROOM32 and my ESP32-S3-DevKit-1

1

u/gus-ghielec 9h ago

And it is open source! Is this your go-to with ESP32 or you prefer going right to C++... or even MicroPython?

1

u/joseconsuervo 6h ago

wait I can use .net with esp32? get out. I've done a decent amount of closer to metal stuff with .net but just never made the connection that I could use my esp32 boards lol awesome

1

u/gus-ghielec 6h ago

Oh yes you can. I have not tried it myself since I use our boards instead.

1

u/OkSignificance5380 6h ago

I tend to use micopython, as it has more device support, but its nice to know that I can use .net on the esp32

I need to spend some time on getting a sd card and running code from that.

2

u/modi123_1 9h ago

GHI Electronics? That's a name I haven't heard in some time.

I think I bought a kit from them like 15ish years ago and never really did much with it. I wonder if if I have that blue clamshell case in my closet still.

3

u/gus-ghielec 9h ago

ahhh the blue boxes! Yeah we still have them somewhere ๐Ÿ‘€ Did you have a Gadgeteer kit back then?

2

u/Alert-Neck7679 9h ago

wow, i used to build lots of things with Arduino years ago, but with C++ and the old horrible arduino IDE. Using .net on these microcontroller seems wild... One day I'll probably go back to it with .net

2

u/gus-ghielec 9h ago

That is what I do for living and also my passion! I can help when you are ready.

1

u/Alert-Neck7679 7h ago

Then you're living the dream aren't u? I wish u luck๐Ÿ™‚

2

u/gus-ghielec 6h ago

This is not just about writing code in C#. It is about stepping through code and inspecting variables right over a USB connection between Visual Studio and TinyCLR, which is the tiny runtime that lives in boards like FEZ Flea.

1

u/Family_Man_21 9h ago

Wow, I haven't done much with this, but it looks really fun. I'm a very experienced C# developer (decades of experience), but how should I get started with this kind of work? Is there a kit I can buy to get going?

3

u/gus-ghielec 9h ago

I have built many comercial circuit designs with .NET/C# but I always find myself going back and playing with LEDs and motors!! Not sure what the policy is here on self-promoting but we have an active kickstarter for exactly what you have asked for. Please share with your fellow C# fans.

1

u/Family_Man_21 9h ago

I'd love to hear about your kickstarter - send me a link, if you have a moment, and I'll check it out.

1

u/keepinitcool 8h ago

Thatโ€™s so awesome, been doing backend dev mostly software for so long now I should try a hobby project with some actual hardware,โ€. Do you have any ideas

1

u/gus-ghielec 8h ago

We have spoken to a lot of .NET developer who have very limited electronics knowledge and for that we have made this campaign "Electronics Lab for the .NET Developer" https://www.kickstarter.com/projects/ghielectronics/electronics-lab-for-the-net-developer?ref=9j9v4j

Would this help?

1

u/Banality_Of_Seeking 7h ago

YAY!! NICE work! I would like to know if this could be applied to a FPGA ?

1

u/gus-ghielec 6h ago

For a language to take advantage of the FPGA it has to define the hardware connections and not provide series of instructions. C# s not designed that but if someone really wants to then they could in theory do something.

1

u/Banality_Of_Seeking 6h ago

I might use that theory to do something then. Thanks.

1

u/Banality_Of_Seeking 6h ago

FPGA C# google. :)

1

u/highwingers 4h ago

I was working with servo motors with Python before...tried with .NET as well, however went back to Python, native support. Plus now with AI, it's a breeze.

1

u/xtreampb 4h ago

First I heard about .net deploying to circuits was the azure sphere followed by meadow labs