M♪o 之學習筆記本《子》開關︰【黑水智】數位之源

派生碼訊

子 鼠

王之渙‧登鸛雀樓

白日依山盡,黃河入海流;
欲窮千里目,更上一層樓。

黑水智︰ 天地如風箱,開關司啟閉,陰 ䷁ 陽 ䷀ 之情見矣。伏羲氏之大易理則,孤虛者的邏輯宇宙,布林代數邏輯電路的數位設計之國度。

 

派未知何年何月,有一

孤虛者言︰

物有無者,非真假也。苟日新,日日新,又日新。真假者,物之論也。論也者,當或不當而已矣。故世有孤虛者,言有孤虛論。孤虛何謂也?甲乙孤虛,言不得全真也,索其孤其虛而已矣。天地孤虛 ,去其上下也,善惡孤虛,何得善惡並真乎?是故孤虛論全矣!

其法曰︰物物孤虛,言物之非也;孤虛之孤虛,此孤虛 之非也。使甲與乙並,此甲乙辜虛之非也,強使之或,乃非甲非乙之孤虛也。若云由此及彼,雖言之鑿鑿,若非彼與此之孤虛,无能以斷疑是也 !!

假使依據孤虛 ── Sheffer 豎線 ──所說則︰

P\sim P = P \mid P

PQP \cdot Q = P \wedge Q = (P \mid Q) \mid (P \mid Q)

PQP + Q = P \vee Q = (P \mid P) \mid (Q \mid Q)

PQP \rightarrow Q =  P  \mid (Q \mid Q)

 

生 開關何物也?

開關是指一個可以使電路開路、使電流中斷或使其流到其他電路的電子元件。最常見的開關是讓人操作機器裝置或下達命令的操作開關,其中有一個或數個電子接點。接點的「閉合」(closed)表示電子接點導通,允許電流流過;開關的「開路」(open)表示電子接點不導通形成開路,不允許電流流過。

Switch

Since the advent of digital logic in the 1950s, the term switch has spread to a variety of digital active devices such as transistors and logic gates whose function is to change their output state between two logic levels or connect different signal lines, and even computers, network switches, whose function is to provide connections between different ports in a computer network.[15] The term ‘switched’ is also applied to telecommunications networks, and signifies a network that is circuit switched, providing dedicated circuits for communication between end nodes, such as the public switched telephone network. The common feature of all these usages is they refer to devices that control a binary state: they are either on or off, closed or open, connected or not connected.

△ 《圖》圖曰︰

彈跳之事需細究,開關物理說分明,簡諧振子道其詳。

【示波器截圖】

200px-Bouncy_Switch

若問軟體將如何?一圖能說省千言。

debouce-graph

 

碼 ︰無 習 。☹

行 ︰雖無金剛鑽,敢作瓷器活。☺,所謂『可出入』者,可『出』即可『入』,何不測試這果真耶?

針太極』  ☿☺ Pin 出入者之電路特性︰

raspberry-pi-circuit-gpio-input-pins

查考《咸澤碼訊》之『針 圖 』︰

a-and-b-physical-pin-numbers

Raspberry-Pi-GPIO-Layout-Revision-2

就選第二十四針, GPIO 8 的吧!

☆ 編者言說明

想 M♪o 應是『上網』查詢,特此擬之以樹莓派網路『針腳』網頁︰

pinout-logo Raspberry Pinout

BCM 8 (SPI Chip Select 0)

Alt0 Alt1 Alt2 Alt3 Alt4 Alt5
SPI0_CE0_N SD0 Reserved
  • Physical pin 24
  • BCM pin 8
  • Wiring Pi pin 10

再閱讀《庫文》【※蓋指程式庫文件】,寫此︰

# 超級者 sudoer 方可以出入無礙
pi@raspberrypi ~ $ sudo -s
root@raspberrypi:/home/pi# python3
Python 3.2.3 (default, Mar  1 2013, 11:53:50) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.

# 載入程式庫
>>> import RPi.GPIO as GPIO

# 使用板子循序編號
>>> GPIO.setmode(GPIO.BOARD)

# 指定出入針
>>> 出針 = 24
>>> 入針 = 24

# 將之設定為『出』針
>>> GPIO.setup(出針, GPIO.OUT)

# 針出『高』勢
>>> GPIO.output(出針, GPIO.HIGH)

# 果真?
>>> GPIO.input(入針)
1

# 針出『低』勢
>>> GPIO.output(出針, GPIO.LOW)

# 當然?
>>> GPIO.input(入針)
0
>>> 

☿☺ , Ah Ha !!

 

訊 ︰☿☹☺ 當真得『大膽假設,小心求證』的哩。