KL46Z code to use in conjunction with a PyQt GUI over a serial communication.

Dependencies:   mbed

You are viewing an older revision! See the latest version

Homepage

Table of Contents

    Here is the Python Code for the PyQt Gui...

    from PyQt4.QtGui import * from PyQt4.QtCore import * import sys import serial

    def printNumber(number): print number ser = serial.Serial('COM5',9600)

    ser.write(unichr(number).encode())

    if name=="main": app=QApplication(sys.argv) slider=QSlider(Qt.Horizontal) slider.setRange(1,127) slider.setFixedWidth(400) slider.setSliderPosition(64)

    QObject.connect(slider,SIGNAL("valueChanged(int)"),printNumber)

    slider.show() sys.exit(app.exec_())


    All wikipages