Skip to content

Commit bc8f812

Browse files
authored
Fix ADC on GPIO35/36 on the M5Core2 (#152)
1 parent 280e4df commit bc8f812

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

nanoFramework.M5Core2/M5Core2.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using Iot.Device.Axp192;
@@ -333,6 +333,12 @@ public static AdcChannel GetAdcGpio(int gpioNumber)
333333

334334
switch (gpioNumber)
335335
{
336+
case 35:
337+
Configuration.SetPinFunction(11, DeviceFunction.ADC1_CH7);
338+
return _adc.OpenChannel(7);
339+
case 36:
340+
Configuration.SetPinFunction(5, DeviceFunction.ADC1_CH0);
341+
return _adc.OpenChannel(0);
336342
case 32:
337343
Configuration.SetPinFunction(32, DeviceFunction.ADC1_CH4);
338344
return _adc.OpenChannel(4);

0 commit comments

Comments
 (0)