From 232c9e3bb3e972f47b86974ad3cc2249bce48865 Mon Sep 17 00:00:00 2001 From: Florian Agbuya Date: Wed, 21 Aug 2024 14:29:08 +0800 Subject: [PATCH] loopback read CH1 --- fast-servo/pyfastservo/loopback.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fast-servo/pyfastservo/loopback.py b/fast-servo/pyfastservo/loopback.py index 12f0a8e..13ee77b 100644 --- a/fast-servo/pyfastservo/loopback.py +++ b/fast-servo/pyfastservo/loopback.py @@ -1,25 +1,24 @@ import time from pyfastservo import adc, dac from pyfastservo.common import ( - ADC_CH0_HIGH_ADDR, - ADC_CH0_LOW_ADDR, - CH0_HIGH_WORD_ADDR, - CH0_LOW_WORD_ADDR, + ADC_CH1_HIGH_ADDR, + ADC_CH1_LOW_ADDR, + CH1_HIGH_WORD_ADDR, + CH1_LOW_WORD_ADDR, read_from_memory, write_to_memory ) -### def read_adc(): - adc_value = adc.read_adc_channel(ADC_CH0_HIGH_ADDR, ADC_CH0_LOW_ADDR) + adc_value = adc.read_adc_channel(ADC_CH1_HIGH_ADDR, ADC_CH1_LOW_ADDR) return adc_value def write_dac(value): dac.set_dac_output(value) def read_dac(): - high_word = read_from_memory(CH0_HIGH_WORD_ADDR, 1)[0] - low_word = read_from_memory(CH0_LOW_WORD_ADDR, 1)[0] + high_word = read_from_memory(CH1_HIGH_WORD_ADDR, 1)[0] + low_word = read_from_memory(CH1_LOW_WORD_ADDR, 1)[0] return (high_word << 8) | low_word def perform_loopback_test(test_value):