だから私はパラレルポートにかなり慣れていて、ここでこのコードを研究してきました->> http://pyserial.svn.sourceforge.net/viewvc/pyserial/trunk/pyparallel/examples/lcd.py?revision=49&view =マークアップ
そして私はここで何が起こっているのか混乱しています
def reveseout(self, x):
r = ((x & (1<<0) and 1) << 7) |\
((x & (1<<1) and 1) << 6) |\
((x & (1<<2) and 1) << 5) |\
((x & (1<<3) and 1) << 4) |\
((x & (1<<4) and 1) << 3) |\
((x & (1<<5) and 1) << 2) |\
((x & (1<<6) and 1) << 1) |\
((x & (1<<7) and 1) << 0)
#print "%02x" % r, "%02x" %x
self.p.setData(r)
ピンを逆にすることは理解していますが、構文自体とそれが文字通り何を言っているのか理解していません。
どんな助けでも大歓迎ですありがとう!