擋風玻璃水撥簡介

左下角是一個速度調節裝置,裝置有4種模式,分別是0,1,2,3。
扭動到不同位置時水撥會有不同速度擺動。

速度調節裝置原理上是用2個switch去控制。A掣和B掣可做到4種情況: not A and not B(0)、A(1)、A and B(2)、B(3) 。

光欄感應會在扭到1時開啟,目的是控制水撥速度,如果水撥經過光欄時便會停止1秒,然後再擺動。變相令水撥速度減慢。

我們利用micro:bit 編程
p12/p8 是光欄的燈
p16/p0 是馬達
(p16/p0 可利用analog 控制放電的比率)
p1 是光欄的sensor
(read p1 =0 等於光被遮擋)
於 micro:bit IO 編程
p13/p14 是光欄的燈
p15/p16 是馬達
(p15/p16 可利用analog 控制放電的比率)
p1 是光欄的sensor
(read p1 =0 等於光被遮擋)