When I run a script on CPython to communicate with the pyboard using pyboard.py, I'm not receiving the return value from the function on the micropython side.
For example purposes, I have a module on the pyboard, ayo.py, containing:
Code: Select all
def getInt():
return 23
def getList():
return [1, 2, 3]
def getBytes():
return bytearray([1, 2, 3])
And my script on CPython (2.7):
Code: Select all
import pyboard
pybo = pyboard.Pyboard('COM5')
pybo.enter_raw_repl()
pybo.exec_("import ayo")
print pybo.exec_("ayo.getInt()")
print pybo.exec_("ayo.getList()")
print pybo.exec_("ayo.getBytes()")
pybo.exit_raw_repl()
pybo.close()
Thanks,
Markus