File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
ports/cxd56/common-hal/analogio Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -114,11 +114,18 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) {
114
114
115
115
// Reference voltage is a fixed value which is depending on the board.
116
116
// e.g.)
117
- // - Reference Voltage of A4 and A5 pins on Main Board is 0.7V.
118
- // - Reference Voltage of A0 ~ A5 pins on External Interface board
119
- // is selected 3.3V or 5.0V by a IO Volt jumper pin.
117
+ // - Reference Voltage of A2 and A3 pins on Main Board is 0.7V.
118
+ // - Reference Voltage of A0 ~ A5 pins on External Interface board is 5.0V
120
119
float common_hal_analogio_analogin_get_reference_voltage (analogio_analogin_obj_t * self ) {
121
- return 0.0f ;
120
+ float voltage ;
121
+
122
+ if (self -> number == 2 || self -> number == 3 ) {
123
+ voltage = 0.0f ;
124
+ } else {
125
+ voltage = 5.0f ;
126
+ }
127
+
128
+ return voltage ;
122
129
}
123
130
124
131
void analogin_reset (void ) {
You can’t perform that action at this time.
0 commit comments