Skip to content

Instantly share code, notes, and snippets.

@romichi
Created May 4, 2012 05:02
Show Gist options
  • Select an option

  • Save romichi/2592156 to your computer and use it in GitHub Desktop.

Select an option

Save romichi/2592156 to your computer and use it in GitHub Desktop.
PC-OP-RS1のLEDを点灯させる
# -*- 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