發表文章

目前顯示的是 4月, 2020的文章

[Python][Voice]Integrate a plot of matplotlib into tkinter GUI/整合matplotlib的繪圖到 tkinter圖形視窗中

圖片
This example shows how to integrate a plot or figure on matplotlib into the graphic user interface of tkinter. 1. Import tkinter 2. Import matplotlib 3. Import FigureCanvasTkAgg 4. Import Figure 5. Build a window named "win". 6. Window format 1: title() 7. Window format 2: geometry() determine size and initial position(x,y) 8. Window format 3: maxsize() set max size of a window 9. Build a figure with figsize = (Width: inch, Length: inch) and dpi = pixel per inch 10. Add the subplot to the figure. 11. Generate x array 12. Generate y array 13. Use plot() to draw the graph 14. Use FigureCanvasTkAgg(figure,win) to put figure on the win (window) 15. Use get_tk_widget().pack() to place figure on the win (window) 16. Build close_win function to end the window 17. Build Button component and give a string to text, and use command to call the function 18. Use pack to arrange Button on bottom side 19. Use mainloop() to keep window running for monitoring and handling events 這個範例說明如

[TouchGFX][STM32F4] Use TextArea to display the value changing on the LCD/使用文字區塊將變動的數值顯示在LCD上(一)

圖片
This example shows how to use TextArea to dispaly the increasing value on the LCD of STM32F429I Disc1. 1. Set parameters of the TextArea: Color, Wildcard. 2. Use snprinf() function to display the TextArea buffer on the LCD. 3. Use handleTickEvent() to update the value periodically. 4. Redraw by using TextArea.invalidate(). 這個範例說明如何使用TextArea,將一個遞增的數值顯示在STM32F429I Disc1開發版的LCD上。 1. 設定TextArea的參數,如顏色、Wildcard。 2. 使用snprinf()將 TextArea buffer的資輛顯示在LCD上。 3. 使用handleTickEvent()去更新數值。 4. 使用TextArea.invalidate()去重繪畫面。 We will share more tutorial videos with people who want to learn LabVIEW and Python welcome to subscribe this channel. 未來會陸續更新影片,讓想學習LabVIEW和Python的朋友可以看影片學習,歡迎訂閱此頻道。 其他網址/related websites: https://labview-tech.blogspot.com/ https://fishark.pixnet.net/blog email: jacklee3633@gmail.com Line: lvnet

[TouchGFX] [STM32F4] Use TouchGFX to design GUI on STM32F429I Disc1/使用TouchGFX設計STM32F429I Disc1開發板的圖形介面

圖片
This example shows how to use TouchGFX to design GUI on LCD of STM32F429I Disc1 Board. One progress indicator and two buttons are used in this example. There are two examples of demonstrating interactions of the button to interact with the circleProgress indicator: 1. setValue 2. Call New Virtual Function --> Use VS code to modify code generated by TouchGFX Tab "Run Simulator" to see the effect of the code. Tab "Run Target" to download the code to STM32F429I Disc1 board. 這個範例說明如何使用TouchGFX設計STM32F429I-Disc1 開發板上LCD的圖形介面。 有兩個按鈕與一個circle Progress顯示項被使用在這的範例上, 有兩個範例說明按鈕與circle Progress顯示項的互動: 1. 設定數值 2. 呼叫新的虛擬函數 -->使用VS code去修改TouchGFX產生的程式碼 按下Run Simulator去看看模擬的效果。 按下Run Target去將程式燒錄在STM32F429I Disc1開發版。   We will share more tutorial videos with people who want to learn LabVIEW and Python welcome to subscribe this channel. 未來會陸續更新影片,讓想學習LabVIEW和Python的朋友可以看影片學習,歡迎訂閱此頻道。 其他網址/related websites: https://labview-tech.blogspot.com/ https://fis

[Python][tkinter]使用Button中的command呼叫函數 Use Button Command Call Function

圖片
This example shows how to use "command" in button to call a function with or without parameters 1. Import tkinter 2. build a window named "win". 3. window format 1: title() 4. window format 2: geometry() determine size and initial position(x,y) 5. window format 3: maxsize() set max size of a window 6. Build Label component and give a string to text 7. Build close_win function to end the window 8. Build add_label_num function to deliver paramters for increasing the text of the label and use lbl.config to change the label status 9. Build Button component and give a string to text, and use command to call the function 10. Build Button component and give a string to text, and use command to call the function with parameters 11. Use pack to arrange Button on bottom side 12. Use pack to arrange Button on left side 13. Use pack to arrange Build Label on right side 14. Use mainloop() to keep window running for monitoring and handling events 這個範例說明如何使用Button

[Python][tkinter] Build tkinter GUI 使用tkinter建立圖形視窗

圖片
This example shows how to build a GUI by using tkinter. 1. Import tkinter 2. build a window named "win". 3. window format 1: title() 4. window format 2: geometry() determine size and initial position(x,y) 5. window format 3: maxsize() set max size of a window 6. Build Button component and give a string to text 7. Use pack to arrange Button on left side 8. Build Label component and give a string to text 9. Use pack to arrange Build Label on right side 10. use mainloop() to keep window running for monitoring and handling events 這個範例介紹如何使用tkinter建立圖形視窗。 #1. 引入tkinter #2. 建立一個名為win的新視窗 #3. 視窗格式: 標題 Title() #4. 視窗格式: 設定視窗啟動時的大小與位置 geometry("寬x長+x位移+y位移") #5. 視窗格式: 設定視窗最大尺寸 maxsize(int長,int寬) #6. 建立Button元件,按鍵文字 Text = "" #7. Button元件布局 pack(side='left') 靠左 #8. 建立Label元件,按鍵文字 Text = "" #9. Label元件布局 pack(side='right') 靠右 #10. mainloop()在使用者關閉視窗之前持續偵測視窗並處理事件               import  tkinter  as  tk   win = tk.Tk

[STM32Cube IDE][TouchGFX] Install ToughGFX in STM32Cube IDE/在STM32Cube IDE中安裝ToughGFX

圖片
這範例是說明如何在STM32Cube IDE中安裝ToughGFX 4.13軟體。 This example demostrates how to install ToughGFX 4.13software in STM32Cube IDE 在使用TouchGFX來設計螢幕的人機介面前,我們需要進行下列幾個步驟: 1. 在STM32Cube IDE中的Additional software中安裝TouchGFX 4.13套件 2. 在新專案中的.ioc檔的Additional software編輯TouchGFX的設定 3. 安裝TouchGFX Designer 4.13做人機介面的編輯。 Before using TouchGFX to desigh the graphic user interface, there are three steps we have to do: 1. Install TouchGFX 4.13 package in STM32Cube IDE-->Additional software. 2. Edit the configuration of TouchGFX in .ioc file in the new project. 3. Install TouchGFX Designer 4.13 for the edition of graphic user interface. We will share more tutorial videos with people who want to learn LabVIEW and Python welcome to subscribe this channel. 未來會陸續更新影片,讓想學習LabVIEW和Python的朋友可以看影片學習,歡迎訂閱此頻道。 其他網址/related websites: https://labview-tech.blogspot.com/ https://fishark.pixnet.net/blog email: jacklee3633 @gmail.com Line: lvnet

[STM32Cube IDE][STM32F429-Disco]Blinky LED Example/閃爍的LED範例

圖片
使用STM32Cube IDE在STM32F429-Disco開發板上撰寫程式控制LED閃爍。 This example shows how to use STM32Cube IDE to blink LED on STM32F429-Discovery kit. 1.開啟STM32Cube IDE, 然後新增專案。 2. 指定PG13和14為數位輸出。 3. 產生程式碼。 4. 修改程式並加入一些HAL函數讓LED閃爍。 1. Start STM32Cube IDE, and add Project. 2. Assign PG13 and 14 as digital output. 3. Generate code. 4. Modify code and add some HAL functions for blinking LED. We will share more tutorial videos with people who want to learn LabVIEW and Python welcome to subscribe this channel. 未來會陸續更新影片,讓想學習LabVIEW和Python的朋友可以看影片學習,歡迎訂閱此頻道。 其他網址/related websites: https://labview-tech.blogspot.com/ https://fishark.pixnet.net/blog email: jacklee3633@gmail.com Line: lvnet