forked from M-Labs/artiq
1
0
Fork 0

Merge pull request #7 from dhslichter/patch-1

lda: fix 32 dB limit, add LDA-302P-1 support
This commit is contained in:
Sébastien Bourdeauducq 2015-01-06 09:57:26 +08:00
commit 1354ccbbc1
1 changed files with 2 additions and 1 deletions

View File

@ -57,6 +57,7 @@ class Lda:
_product_ids = { _product_ids = {
"LDA-102": 0x1207, "LDA-102": 0x1207,
"LDA-602": 0x1208, "LDA-602": 0x1208,
"LDA-302P-1": 0x120E,
} }
def __init__(self, serial=None, product="LDA-102"): def __init__(self, serial=None, product="LDA-102"):
@ -158,4 +159,4 @@ class Lda:
:type attenuation: int, float or Fraction :type attenuation: int, float or Fraction
""" """
self.set(0x8d, bytes(chr(int(round(attenuation*4))), "ascii")) self.set(0x8d, bytes([int(round(attenuation*4))]))