### ghi nho (筆記 arduino) ## 2024/09/20 ## 準備環境 1.練習使用 hackmd.io 作筆記 https://hackmd.io/ 螢幕可以下來,使用 【ctrl】+[windows]+S 螢幕 2.筆記 ![image](https://hackmd.io/_uploads/rkwuWC7RR.png) 3.上課網址:dic.vbird.tw ![image](https://hackmd.io/_uploads/BJyxg5caC.png) 4.使用 python https://colab.research.google.com/?hl=zh-tw ![image](https://hackmd.io/_uploads/Sko9eqcaA.png) ![colab-01](https://hackmd.io/_uploads/Sy4x-RXCC.jpg) 4.算BMI ![image](https://hackmd.io/_uploads/rk8fM5cTC.png) ![image](https://hackmd.io/_uploads/Sy0MMsqTC.png) # 2024/09/27 ## 1. ![image](https://hackmd.io/_uploads/BJLMUiQAC.png) ## 2. ![image](https://hackmd.io/_uploads/r1QfcjQ0C.png) ## 3. ![image](https://hackmd.io/_uploads/SyXucoXRR.png) ## 4. ![image](https://hackmd.io/_uploads/S1PXEaXAC.png) ## 5.使用 if ``` if a== b: print(true) else: print(false) ``` ![image](https://hackmd.io/_uploads/BJlIwaXR0.png) 可以这样 ``` # 4.2.1 myday = 'friday' if myday == 'monday': print('I am blue..') else: print('working hard today') ``` ## 常使用的運算子則有 X == Y X != Y X < Y X <= Y X > Y X >= Y ## 7.在 python ``` import datetime mydate = (datetime.datetime.now() ) print( mydate ) ``` ![image](https://hackmd.io/_uploads/B1xHYTXCR.png) ![image](https://hackmd.io/_uploads/r1fpRTQRA.png) ## 8.使用 if ... elif ... else 進行多重條件判斷 例如: 一個禮拜7天。不同日不同偷出資訊 希望執行程式會出現 *星期1-4 要上班 *星期5要上課 *星期6,7 可以休息 ``` # 4.2.3 import datetime myday = datetime.datetime.now() wday = int(myday.strftime("%w")) if wday >=1 and wday <=4: print ("要上班") elif wday == 5: print ("須上課") elif wday == 6 or wday == 0: print("hehe") ``` ![image](https://hackmd.io/_uploads/rkBTrCQ0C.png) ## 9. 使用 for 迴圈搭配數值 range() 與字串陣列 ``` # 4.3.1 testing for range for wday in range(7): if wday >=1 and wday <=4: print (wday, "工作") elif wday == 5: print (wday, "讀書") elif wday == 6 or wday == 0 : print(wday, "休息") ``` ![image](https://hackmd.io/_uploads/Hy51aR7AA.png) # 2024/10/04 ## 1.了解 indent 的錯誤 ![image](https://hackmd.io/_uploads/S1LJXkpCA.png) ![image](https://hackmd.io/_uploads/B1UGmkT00.png) ## 2.雙重迴圈 vòng lặp đôi ![image](https://hackmd.io/_uploads/H1-ESypCR.png) ``` # 4.3.1 using for (說明,不會被執行) # 第一次使用 for print ("hello python") for x in range(1,10): print(x) for y in range(1,10): print('\t',y) ``` ## 3. 9x9 乘法表 Vòng lặp lồng nhau cho bảng cửu chương ``` # 4.3.1 using for (說明,不會被執行) # show 9x9=81 print (" 9x9 = 81") for x in range(2,10): print ('xxxxxxxxxxxxxxxxxxxxxx') for j in range(2,10): print( str(x) + ' x ' + str(j) + " = " + str(x*j) ) ``` ![image](https://hackmd.io/_uploads/HJv2xbTCC.png) ## 4.Chuỗi sử dụng phương thức lặp của mảng ![image](https://hackmd.io/_uploads/S1jCFWpAR.png) ``` # 4.3.3 array soup = [ "牛蒡雞湯", "玉米蛋花湯", "芹菜餛飩湯", "薑絲海苗湯", "綠豆薏仁湯" ] print (soup) for x in range(len(5)): print (x, ':'soup[x]) ``` ## 5.使用亂數,讓程式自己找出要的數字 Sử dụng các số ngẫu nhiên và để chương trình tự tìm số mong muốn ![image](https://hackmd.io/_uploads/H1R4fM60A.png) ## 6. BMI ![image](https://hackmd.io/_uploads/HyjSwz6RA.png) # 2024/10/11 ## 1.使用 while 迴圈搭配 Sử dụng vòng lặp while với hàm break và continue 列出星期1 到星期 7,列出 i need working ![image](https://hackmd.io/_uploads/ByYcsMIkye.png) ![image](https://hackmd.io/_uploads/H1TeaMLJ1x.png) # 2.break 與 continue 功能 ![image](https://hackmd.io/_uploads/S1ZGJQUJ1e.png) # 3。作業 ![image](https://hackmd.io/_uploads/rkuwc4LJye.png) ![image](https://hackmd.io/_uploads/Hk9-uSU1yl.png) ### 2024/10/18 Arduino ## 1. ![image](https://hackmd.io/_uploads/r1Bh7Ukekg.png) # a. ![image](https://hackmd.io/_uploads/HkxDTIJxJg.png) # b. ![image](https://hackmd.io/_uploads/HkB66Uyeyl.png) # c. ![image](https://hackmd.io/_uploads/HJ2nO_1lkl.png) # d. ![image](https://hackmd.io/_uploads/SJHOtOJeyx.png) # e. ![image](https://hackmd.io/_uploads/BkW1-9dlkg.png) # f.coppy ![image](https://hackmd.io/_uploads/Hy7MW5Oeke.png) ## 2024/10/25 # 1.每次上課都要檢查的項目 1.打开电脑 2.cam arduino vao usb 3.mo cai dat xem co ch340/ch341 ![image](https://hackmd.io/_uploads/HJRc-cdekg.png) 4.arduino IDE 5.kiem tra ![image](https://hackmd.io/_uploads/rJFHf5dgJx.png) ## 2.Tim loi sai ![image](https://hackmd.io/_uploads/BJmyPcuxye.png) tinh kiwi ![image](https://hackmd.io/_uploads/HJJavmkFkx.png) ## 2024/11/1 # 1.Serial.readString() ![image](https://hackmd.io/_uploads/r1i61AZb1e.png) # 2024/12/06 1. ![image](https://hackmd.io/_uploads/ByIOeel4Jl.png)