-
Notifications
You must be signed in to change notification settings - Fork 1
/
serial_monitor.pn
1 lines (1 loc) · 2.26 KB
/
serial_monitor.pn
1
[{'code': 'import serial # sudo pip3 install pyserial\n#import time\n', 'size': (495, 58), 'x': 283, 'y': 547, 'parent': 11, 'type': 'field', 'connects': []}, {'code': "def open_port(port='', baud=9600):\n ser = serial.Serial(port, baudrate=baud) # open first serial port\n return ( ser, ser.portstr, ser.baudrate )\n", 'size': (300, 150), 'x': 293, 'y': 390, 'parent': 12, 'color': (81, 102, 105), 'type': 'node', 'connects': [{'input': {'put': {'name': 'port'}}, 'output': {'node': 13, 'put': {'name': 'output'}}}, {'input': {'put': {'name': 'baud'}}, 'output': {'node': 20, 'put': {'name': 'output'}}}]}, {'code': "'/dev/ttyACM0'", 'size': (208, 30), 'x': 185, 'y': 459, 'parent': 13, 'type': 'field', 'connects': []}, {'code': "'/dev/ttyACM0'", 'size': (150, 30), 'x': 401, 'y': 301, 'parent': 14, 'type': 'field', 'connects': [{'input': {'put': {'name': 'input'}}, 'output': {'node': 12, 'put': {'name': 'ser.portstr'}}}]}, {'code': '115200', 'size': (94, 30), 'x': 545, 'y': 301, 'parent': 15, 'type': 'field', 'connects': [{'input': {'put': {'name': 'input'}}, 'output': {'node': 12, 'put': {'name': 'ser.baudrate'}}}]}, {'code': "def read_port(ser=None):\n #while True:\n string = ser.readline()\n #s = ser.read()\n length = len(string)\n hex = ['0x%02x ' % b for b in string]\n# time.sleep(1.)\n return ( length, string, hex )", 'size': (300, 150), 'x': 248, 'y': 275, 'parent': 16, 'color': (98, 96, 91), 'type': 'node', 'connects': [{'input': {'put': {'name': 'ser'}}, 'output': {'node': 12, 'put': {'name': 'ser'}}}]}, {'code': '10', 'size': (70, 30), 'x': 81, 'y': 184, 'parent': 17, 'type': 'field', 'connects': [{'input': {'put': {'name': 'input'}}, 'output': {'node': 16, 'put': {'name': 'length'}}}]}, {'code': "b'900,0.00\\r\\n'", 'size': (288, 130), 'x': 291, 'y': 134, 'parent': 18, 'type': 'field', 'connects': [{'input': {'put': {'name': 'input'}}, 'output': {'node': 16, 'put': {'name': 'string'}}}]}, {'code': "['0x39 ', '0x30 ', '0x30 ', '0x2c ', '0x30 ', '0x2e ', '0x30 ', '0x30 ', '0x0d ', '0x0a ']", 'size': (300, 128), 'x': 629, 'y': 134, 'parent': 19, 'type': 'field', 'connects': [{'input': {'put': {'name': 'input'}}, 'output': {'node': 16, 'put': {'name': 'hex'}}}]}, {'code': '115200\n', 'size': (108, 30), 'x': 357, 'y': 459, 'parent': 20, 'type': 'field', 'connects': []}]