File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
ports/raspberrypi/common-hal/analogio Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change 26
26
27
27
#include "common-hal/analogio/AnalogIn.h"
28
28
#include "shared-bindings/analogio/AnalogIn.h"
29
+ #include "shared-bindings/microcontroller/__init__.h"
29
30
#include "shared-bindings/microcontroller/Pin.h"
30
31
#include "py/runtime.h"
31
32
#include "supervisor/shared/translate/translate.h"
@@ -81,6 +82,7 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
81
82
uint32_t old_ctrl = iobank0_hw -> io [self -> pin -> number ].ctrl ;
82
83
adc_gpio_init (self -> pin -> number );
83
84
adc_select_input (self -> pin -> number - ADC_FIRST_PIN_NUMBER );
85
+ common_hal_mcu_delay_us (100 );
84
86
value = adc_read ();
85
87
gpio_init (self -> pin -> number );
86
88
padsbank0_hw -> io [self -> pin -> number ] = old_pad ;
You can’t perform that action at this time.
0 commit comments