|
|
@ -4,14 +4,22 @@ import time |
|
|
|
import gex |
|
|
|
import gex |
|
|
|
|
|
|
|
|
|
|
|
with gex.DongleAdapter(gex.TrxRawUSB(remote=True), 0x10) as transport: |
|
|
|
with gex.DongleAdapter(gex.TrxRawUSB(remote=True), 0x10) as transport: |
|
|
|
|
|
|
|
# with gex.TrxRawUSB() as transport: |
|
|
|
|
|
|
|
|
|
|
|
# connect GEX client library to the remote slave |
|
|
|
# connect GEX client library to the remote slave |
|
|
|
client = gex.Client(transport) |
|
|
|
client = gex.Client(transport) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do = gex.DOut(client, "led") |
|
|
|
adc = gex.ADC(client, "adc") |
|
|
|
adc = gex.ADC(client, "adc") |
|
|
|
|
|
|
|
|
|
|
|
print(adc.read_smooth()) |
|
|
|
while True: |
|
|
|
|
|
|
|
do.toggle(confirm=True) |
|
|
|
|
|
|
|
print(adc.read_smooth()) |
|
|
|
|
|
|
|
time.sleep(0.2) |
|
|
|
|
|
|
|
|
|
|
|
print(adc.read_raw()) |
|
|
|
# adc = gex.ADC(client, "adc") |
|
|
|
|
|
|
|
# for j in range(10): |
|
|
|
# this will fail unless the communication works |
|
|
|
# try: |
|
|
|
|
|
|
|
# print(adc.read_smooth()) |
|
|
|
|
|
|
|
# except: |
|
|
|
|
|
|
|
# print("Failed") |
|
|
|