From c61e22180900fc21d053881148a29ecedea3dad1 Mon Sep 17 00:00:00 2001 From: David O'Connor Date: Tue, 31 Oct 2023 10:27:29 -0400 Subject: [PATCH] Added ead_voltage method to ADC --- src/adc.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/adc.rs b/src/adc.rs index 902b09d..764590d 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -933,6 +933,11 @@ macro_rules! hal { self.read_result() } + pub fn read_voltage(&mut self, channel: u8) -> f32 { + let reading = self.read(channel); + self.reading_to_voltage(reading) + } + /// Select and activate a trigger. See G4 RM, section 21.4.18: /// Conversion on external trigger and trigger polarit