Try   HackMD

參考文獻

VS Code Getting Start

Install Visual Studio Code

VS code

Install Python

  1. 下載並安裝Python
  2. 於 Extensions 搜尋 phthon,並安裝以下擴充件。
  • Python
  • Python Extension Pack

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Install Python package

於 Packages 安裝以下元件

  • matplotlib
  • control
  • numpy

方法一:透過Python Environment Manager安裝

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

方法二:透過終端機下指令安裝

開啟終端機

py -3 --version  確認 python 版本

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

py -m pip install matplotlib
py -m pip install control
py -m pip install numpy
py -m pip install SymPy
py -m pip install Pandas
py -m pip install PyWavelets

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

New file

選擇 python file

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Test code

物聯網高手的自我修練:帶你玩轉樹莓派、Arduino 與ESP32

import numpy as np
import matplotlib.pyplot as plt
import control
wc = 2 * np.pi * 5
LPF = control.tf([wc], [1, wc])
w = np.logspace(-1.5,3,200)
phase = control.bode(LPF, w, Hz=True, dB=False, deg=True)
plt.show()

Run code

按下Run Python File後,會跑出波德圖。

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →