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

2024-09-30 08:28:44 发布

您现在位置:Python中文网/ 问答频道 /正文

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


Tags: 方法gui微控制器接收数据msp430g2
1条回答
网友
1楼 · 发布于 2024-09-30 08:28:44
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

相关问题 更多 >

    热门问题