cdump / radiacode

Library for RadiaCode-101
MIT License
101 stars 18 forks source link

Some addition for writing calibration into device. #26

Closed Am6er closed 5 months ago

Am6er commented 5 months ago

Hi! Some addition for writing calibration into RC device. Sorry i'm too lazy to do PR. :(

    def set_energy_calib(self, calib: List[float]) -> None:
        calib_b = struct.pack('<fff', calib[0], calib[1], calib[2])
        calib_len = len(calib_b)
        payload = struct.pack('<II', int(VS.ENERGY_CALIB), calib_len) + calib_b
        r = self.execute(b'\x27\x08', payload)
        retcode = r.unpack('<I')[0]
        assert retcode == 1
cdump commented 5 months ago

thanks, in master