發表文章

目前顯示的是 6月, 2021的文章

類比-電位器實驗讀取類比值-micropython

圖片
  類比-電位器實驗讀取類比值-micropython

PWM-呼吸燈-micropython

圖片
  PWM-呼吸燈 所需零件 ESP32 5mm LED 330 歐姆電阻 麵包板 跳線 程式碼 參照--我的 micropython函式筆記本 from   machine   import   Pin ,  PWM from   time   import   sleep led  =  PWM ( Pin ( 4 ),  freq = 5000 ) while   True :      for   duty_cycle1   in   range ( 0 ,  1000 ,  10 ):          led . duty ( duty_cycle1 )          sleep ( 0.05 )      for   duty_cycle2   in   range ( 1000 ,  0 , - 10 ):          led . duty ( duty_cycle2 )          sleep ( 0.05 )

按鈕控制LED-micropython

圖片
  按鈕控制LED--micropython 接線 from   machine   import   Pin from   time   import   sleep led  =  Pin ( 2 ,  Pin . OUT ) button  =  Pin ( 4 ,  Pin . IN ) while   True :      led . value ( button . value ())      sleep ( 0.5 )

micropython函式筆記

圖片
  micropython函式筆記 執行micropython所須載入的模組 from   machine   import   Pin 設定接腳輸出入 Pin ( 腳位 , Pin .OUT )---- 輸出 Pin ( 腳位 , Pin.IN )---- 輸入 value()讀取值 例: button= Pin ( 2 , Pin.IN ) button .value()