我如何使我的python脚本与MSP430启动板通信?

问题描述 投票:0回答:1

我想用python创建一个GUI,并使它与我的微控制器板(MSP430G2)交互。想知道两者之间是否有任何发送/接收数据的方法。

python python-3.x msp430
1个回答
0
投票
pip install python-msp430-tools

if __name__ == '__main__':
    from msp430.util import hexdump
    import time
    mmc = MMC()
    try:
        mmc.connect()
        print mmc.info()
        #show what's there
        hexdump((0, mmc.read(0)))
        #speed test
        t1 = time.time()
        for n in range(10):
            mmc.read(n)
        t2 = time.time()
        dt = t2 - t1
        bytes = n * 512
        print "%d bytes in %.2f seconds -> %.2f bytes/second" % (bytes, dt, bytes/dt)
    finally:
        mmc.release()

python-msp430-tools

© www.soinside.com 2019 - 2024. All rights reserved.