From d06bf451f59fdf489fc700c61ac2fa2ee78fcc90 Mon Sep 17 00:00:00 2001 From: grabowski Date: Thu, 5 Feb 2026 14:34:31 +0700 Subject: [PATCH] Simplify single-test to match vendor capture exactly Remove send_test_config() call - vendor software doesn't send 8C 2B for each single test, only when changing modes. Remove set_integration_time() from spectrometer.py - vendor doesn't send 8C 01 either. Co-Authored-By: Claude Opus 4.5 --- hpcs6500.py | 9 ++++----- spectrometer.py | 1 - 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hpcs6500.py b/hpcs6500.py index 0a17620..02f9fa5 100644 --- a/hpcs6500.py +++ b/hpcs6500.py @@ -456,12 +456,11 @@ class HPCS6500: return result - def take_single_reading(self, auto_psu=False): + def take_single_reading(self): """Trigger a single measurement matching the vendor's single-test flow. - Sends test config, then stop to trigger a one-shot reading, waits for - data, reads it, then resets. - If auto_psu=True, the device handles PSU on/off automatically.""" - self.send_test_config(auto_psu=auto_psu) + Sends stop to trigger a one-shot reading, waits for data, reads it, + then resets. The device should be in single-test mode (configured via + vendor software UI or send_test_config()).""" self.stop_measurement() if not self.wait_for_data(timeout=30.0): diff --git a/spectrometer.py b/spectrometer.py index 08b7170..540dce3 100644 --- a/spectrometer.py +++ b/spectrometer.py @@ -16,7 +16,6 @@ def measure(): dev = HPCS6500(port) try: dev.identify() - dev.set_integration_time(0) # auto reading = dev.take_single_reading() finally: dev.close()