1. Home
  2. Platforms
  3. Code in C# on your Unexpected Maker ESP32-S2 & ESP32-S3 boards!

Code in C# on your Unexpected Maker ESP32-S2 & ESP32-S3 boards!

nanoFramework is a free and Open Source platform that enables the writing of managed code applications for constrained embedded devices.

As a developer, you can use your powerful and familiar tools like Microsoft Visual Studio IDE and your .NET C# skills to write code on your microcontroller.

nanoFramework already supported the FeatherS2, but they just released support for ESP32-S3 boards, including the FeatherS3!

Check out their getting started guide as well as their support guides for ESP32-S2 and ESP32-S3.

Using ADC pins in nanoFramework

Unlike other development platforms for the ESP32, nanoFramework doesn’t reference ADC pins via their IO#, but instead requires the IO ADC channel number to create an ADC reference.

For example, to read the battery voltage on the FeatherS3, instead of accessing the ADC via IO2, you would instead setup the ADC as follows:

AdcController adcController = new AdcController();
AdcChannel adcChannel = adcController.OpenChannel(1);
int v = adcChannel.ReadValue();

I have updated the pinout cards for the FeatherS3 to indicate the ADC number and Channel number for the VBAT Sense and Ambient light sensor IO.

Updated on February 8, 2024

Related Articles