|
6 | 6 | port = "unknown" |
7 | 7 | port = "/dev/cu.SLAB_USBtoUART" |
8 | 8 | #port = "COM3" |
| 9 | +print("start") |
9 | 10 | ESP32 = uc2rest.UC2Client(serialport=port, baudrate=115200, DEBUG=True) |
10 | 11 | #ESP32.serial.sendMessage('{"task":"/home_act", "home": {"steppers": [{"stepperid":1, "timeout": 20000, "speed": 15000, "direction":1, "endposrelease":3000}]}}') |
11 | 12 |
|
|
40 | 41 | mState = ESP32.state.get_state() |
41 | 42 |
|
42 | 43 |
|
43 | | -''' ################ |
44 | | -MODULES |
45 | | -################''' |
46 | | -#load modules from pyhton |
47 | | -mModules = ESP32.modules.get_default_modules() |
48 | | -assert mModules["home"] == 0 or mModules["home"] == 1, "Failed loading the default modules" |
49 | | -print(mModules) #{'led': True, 'motor': True, 'home': True, 'analogin': False, 'pid': False, 'laser': True, 'dac': False, 'analogout': False, 'digitalout': False, 'digitalin': True, 'scanner': False, 'joy': False} |
50 | | - |
51 | | -# load modules from device |
52 | | -mModulesDevice = ESP32.modules.get_modules() |
53 | | -#assert mModulesDevice["home"] == 0 or mModulesDevice["home"] == 1, "Failed loading the modules from the device" |
54 | | -print(mModulesDevice) #{'led': True, 'motor': True, 'home': True, 'analogin': False, 'pid': False, 'laser': True, 'dac': False, 'analogout': False, 'digitalout': False, 'digitalin': True, 'scanner': False, 'joy': False} |
55 | | -mModules['home']=1 # activate home module |
56 | | -#%% |
57 | 44 |
|
58 | 45 |
|
59 | 46 | ESP32.motor.move_x(steps=10000, speed=10000, is_blocking=True) |
|
67 | 54 | # check if we are connected |
68 | 55 | # see if it's the right device |
69 | 56 | mState = ESP32.state.get_state() |
70 | | -assert mState["state"]["identifier_name"] == "UC2_Feather", "Wrong device connected" |
| 57 | +#assert mState["state"]["identifier_name"] == "UC2_Feather", "Wrong device connected" |
71 | 58 |
|
72 | 59 | #%% |
73 | 60 | # test Motor |
|
0 commit comments