Created
May 4, 2012 05:02
-
-
Save romichi/2592156 to your computer and use it in GitHub Desktop.
PC-OP-RS1のLEDを点灯させる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding:utf-8 -*- | |
| import serial | |
| import struct | |
| import binascii | |
| ser=serial.Serial(4, 115200, timeout= 1) #シリアルポートにアクセス | |
| ser.write(struct.pack('B', 0x69)) #0x69を送り,ACCESS LEDを点灯させる | |
| print binascii.hexlify(ser.read(1)) #正常なら0x4fが,0x59ならLEDは点かない | |
| ser.close() #接続を閉じる |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment