--- title: 'Project documentation template' disqus: hackmd --- Project Title === ![downloads](https://img.shields.io/github/downloads/atom/atom/total.svg) ![build](https://img.shields.io/appveyor/ci/:user/:repo.svg) ![chat](https://img.shields.io/discord/:serverId.svg) ## Table of Contents [TOC] ## Beginners Guide If you are a total beginner to this, start here! 1. Visit hackmd.io 2. Click "Sign in" 3. Choose a way to sign in 4. Start writing note! User story --- ```gherkin= Feature: Guess the word # The first example has two steps Scenario: Maker starts a game When the Maker starts a game Then the Maker waits for a Breaker to join # The second example has three steps Scenario: Breaker joins a game Given the Maker has started a game with the word "silky" When the Breaker joins the Maker's game Then the Breaker must guess a word with 5 characters ``` > I choose a lazy person to do a hard job. Because a lazy person will find an easy way to do it. [name=Bill Gates] ```gherkin= Feature: Shopping Cart As a Shopper I want to put items in my shopping cart Because I want to manage items before I check out Scenario: User adds item to cart Given I'm a logged-in User When I go to the Item page And I click "Add item to cart" Then the quantity of items in my cart should go up And my subtotal should increment And the warehouse inventory should decrement ``` > Read more about Gherkin here: https://docs.cucumber.io/gherkin/reference/ User flows --- ```sequence Alice->Bob: Hello Bob, how are you? Note right of Bob: Bob thinks Bob-->Alice: I am good thanks! Note left of Alice: Alice responds Alice->Bob: Where have you been? ``` > Read more about sequence-diagrams here: http://bramp.github.io/js-sequence-diagrams/ Project Timeline --- ```mermaid gantt title 工作時程 axisFormat %m/%d section 整體 討論整合 :2022/08/22,2022/08/31 組裝、配線 :2022/10/3 測試、調整 :2022/10/18 section 系統控制組 腳位配置 :2022/9/10, 2022/9/16 ``` ```mermaid gantt axisFormat %m/%d section 整體 實戰測試、調整 :2022/10/18, 2022/10/30 影片製作 :2022/11/4,2022/11/15 section 軟體組 影片剪輯 :2022/11/10, 5d ``` ```mermaid gantt title 工作時程 axisFormat %m/%d section 整體 討論整合 :2022/08/22,2022/08/31 組裝、配線 :2022/10/3 測試、調整 :2022/10/18 實戰調整 :2022/10/30 影片製作 :2022/11/4,2022/11/15 section 系統控制組 腳位配置 :2022/9/10, 2022/9/16 section 軟體組 影片剪輯 :2022/11/10, 5d ``` > Read more about mermaid here: http://mermaid-js.github.io/mermaid/ ## Appendix and FAQ :::info **Find this document incomplete?** Leave a comment! ::: ###### tags: `Templates` `Documentation` --- [2022東京威力科創機器人大賽](https://officecycu-my.sharepoint.com/:f:/g/personal/10823160_o365st_cycu_edu_tw/EpCOxIM0h0BIingQCv61tOYB1F_bY5e4jfDGAk4_mHT1JA?e=a4EE4J) [第三屆人工智慧與大數據全國創意競賽](https://docs.google.com/document/d/1zU9faEeNsG4sng-_w3LtpRmCDFdkItji/edit) --- ## 2022/6/5 10. 不用box,取代用板子為基礎。 ## 2022/6/7 10. 那就用xbox吧 ## 2022/6/23 10. 先把遊戲規則敘述一次,再將所有機構設計和軟體設計整合 在遊戲規則中可再討論原先淘汰的想法,互相比較優缺做整合 分為軟體組與硬體組分別寫內容 下次開會:6/30 7/1交報名表 7/8交計畫書 ## 2022/7/3 撰寫主要內容 繳交計劃書延至7/11 ## 2022/7/4 精修內容與排版 ## 2022/7/6 齁齁齁今天好像要把報名表完成ㄌㄨㄛ 計畫表寫完囉 ## 2022/7/25 8/10簡報deadline 8/20到竹科 下次開會:8/3 9:00 PM 計劃書摘要 1. 創作敘述 2. 功能需求 3. 設計概念與佈置 4. 創意與技術 5. 預算規劃 6. 工作時程表 簡報大綱 1. 硬體 2. 電控 3. 軟體 4. 關卡破解及構想 > 當天服裝: 老師詢問 > [time=Mon, Jul 25, 2022 9:33 PM] ## 2022/8/3 分享進度 衣服: 領子、深色(線上,會問問題 8/20) 簡報分配(內容幾分鐘的時間): - 電控:大約1 min 第一頁所需材料 第二頁詳述 第三頁接角(重點) - 軟體:大約 1 min 30s 第一部分 ros 1.特色 2.實作方式 3.案例 第二部分 github(action) - 介紹ROS - 10秒 歷史沿革 特色 - 實作流程 - 30秒 加速交流 多語言開發 使用TCP/IP通訊協定 - 實際案例 - 20秒 - Github Actions - 30s - 硬體:大約 1 min 30s 第一部分整體結構 第二部分結構構思 - 解題:大約 2 min - 計劃書內容修改 --- deadline: - 8/6 9pm 修簡報及加強 - 8/7 9pm 報告初稿及預錄 - 8/8 9pm 正式錄影處理 next 硬體組紀錄 --- ## 2022/8/6 1. 簡報完成 2. 討論 簡報大綱 1. 硬體 2. 電控 3. 軟體 4. 關卡破解及構想 5. 小結論 6. 工作時程表 甘特圖 ## 2022/8/7 1. 簡報完成(分主題使用) 2. 討論報告分配 3. 給老師審視內容 ## 2022/8/8 第一次:硬體組太長 過 4 min 30s (已過總長) 第二次:道關卡破解 7 min 7 s 第三次:關卡破解往後 2 min 50 s 已小修一下段,但還是有做調整!時間會超過太多。 > 軟體組撰寫 --- ## 2022/10/16 > 硬體組撰寫 1. 機械手臂初號機完成 ![](https://i.imgur.com/H9rFqqx.jpg) 2. 底板底稿設計完成 ![](https://i.imgur.com/wwHshMm.jpg) 3. 進料進度:40% > 電控組撰寫 - 研究樹莓派如何連接驅動板到機械手臂 > 軟體組撰寫 因開發板未到,先去洗三塊 OS Ubuntu server 20.04 LTS, and set up ssh, ros system. 已有看式 [raspberry-pi](https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#3-using-advanced-options) ![](https://i.imgur.com/zkWYPKP.png) [ros-pwm-pca9685 github](https://github.com/dheera/ros-pwm-pca9685) ![](https://i.imgur.com/XK1yJ2r.png) 先跟硬體組配合,用 arduino 做測試看看可不可以抓東西。 --- ## 2022/10/21 > 軟體組 10/18 樹梅剛到 10/20 先洗好三顆 OS 10/21 拿到樹梅開始做自動化安裝測試 結果燒入有問題雙方重燒 有給自動化程式 10/22 yolov2 tiny fps only 0.1, so 考慮加速器 auto install basic program ```zsh= # /usr/bin/bash # setting NCHC in Taiwan sudo sed -i 's/archive.ubuntu.com/free.nchc.org.tw/g' /etc/apt/sources.list sudo sed -i 's/security.ubuntu.com/free.nchc.org.tw/g' /etc/apt/sources.list sudo sed -i 's/ports.ubuntu.com/free.nchc.org.tw/g' /etc/apt/sources.list echo "finished change server" sleep 1 # update default sudo apt clean all sudo apt-get update && sudo apt-get upgrade -y echo "finished updgrade" sleep 1 ## install desktop echo "Do you need a desktop version? (If needing it to input 1 number)" read number if [ $number == 1 ];then sudo apt install xubuntu-desktop -y sudo apt install lubuntu-desktop -y echo "finished desktop update" sleep 1 fi #package install sudo apt-get install -y git tmux neofetch echo "install git tmux neofetch" neofetch sleep 1 # zsh install echo "Do you need oh-my-zsh? (If needing it to input 1 number)" read number if [ $number == 1 ];then sudo apt-get install -y zsh zsh --version cat /etc/shells chsh -s $(which zsh) sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" sudo apt-get install -y fonts-powerline echo "finished zsh install" sleep 1 fi # ROS install echo "Do you need ROS? (If needing it to input 1 number)" read number if [ $number = 1 ]; then sh -c "$(curl -fsSL https://raw.githubusercontent.com/Adlink-ROS/ros_menu/master/scripts/setup.sh)" sleep 1 fi sudo reboot ``` --- ## 2022/10/23 > 硬體組撰寫 1. 底板草圖完成 進行軟體繪製 2. 進行第二層規劃 --- ## 2022/10/30 > 電控組撰寫 Last Update:2022/11/30 --- 使用元件: 1.Arduino uno:DC 5V 2.Jetson nano:DC 4.75V 3.TB6560:DC 10V ~ 35V (建議使用DC 24V)。 ~~4.57馬達:DC 24V ~ 36V~~ 5.電磁閥:DC 3V~7.2V 6.真空汞:DC 5V~7.2V 7.PCA9685:DC 5V~10V --- 供電使用方案與利用狀況: * 以下所述之電池以18650為主 (1)、(2)接行動電源 (3)、(4)-------每一組3.7* 4=14.8V-----4* 4=16顆電池 但有無法跑完全程的隱憂,因為電壓還是不夠高 (5)-------1顆電池-----3.7V (6)-------4顆<font color="#f00">AA電池</font>-----1.5V*4=6V (7)接Jetson * 電池剩餘:2顆、電池座:2顆串聯 x1、1顆x1 --- Arduino腳位定義 ![](https://i.imgur.com/RzoO3Lh.png) TB6560腳位定義,<font color="#f00">所有驅動器在通電後不得撥動撥碼開關!</font> ![](https://i.imgur.com/5BsGfLr.png) ![](https://i.imgur.com/U7JOjlv.png) TB6560電流參數設定 ![](https://i.imgur.com/zrgoGup.png) ![](https://i.imgur.com/8L8elnK.png) ![](https://i.imgur.com/kv7LJRq.png) [如何將 TB6560 步進電機驅動器與 Arduino 一起使用。](https://mytectutor.com/how-to-use-tb6560-stepper-motor-driver-with-arduino/) [How to run stepper motor using TB6560 stepper driver(影片示範)](https://www.youtube.com/watch?v=KRoe4_XM884) Arduino、TB6560、馬達接線示意圖 ![](https://i.imgur.com/UHCmKgf.png) 57馬達電壓參數 ![](https://i.imgur.com/6kzOVt8.png) 電源、TB6560(霸拖把L298N在腦海中替換掉QAQ)、Arduino、Jetson板接線圖 ![](https://i.imgur.com/55OdOGo.jpg) Arduino、Jetson板利用GPIO串接線路圖 ![](https://i.imgur.com/ZAKHNFM.png) 鏡頭模組連接Jetson板示意圖 ![](https://i.imgur.com/LynlXOg.png) 相機排線插入方向(藍色的那邊),<font color="#f00">++不要++插反</font> 也<font color="#f00">++不要++在通電時插拔排線(熱插拔)</font> ![](https://i.imgur.com/Lnk66oZ.jpg) Jetson板腳位定義 PCA9685(步進馬達驅動器)連接Jetson板接線圖 ![](https://i.imgur.com/QK5tkPb.jpg) 電磁閥、真空汞接線圖 ![](https://i.imgur.com/xsk5aAw.png) 電磁閥、真空汞電壓參數 ![](https://i.imgur.com/iAIEIfe.png) 電磁閥、Arduino接線圖 ![](https://i.imgur.com/6wRwmW7.png) ![](https://i.imgur.com/9NaD4By.png) ![](https://i.imgur.com/Gir8l4N.png) ![](https://i.imgur.com/Ufzdagn.png) --- > 軟體組撰寫 10/26 樹梅派跑 yolov5可以但吃力,會死機的問題 yolov5是python為主去訓練,所以以v5訓練模型試試 嘗試借jetson版 10/27 借到jetson版 10/30 study jetson 燒入系統,但沒有網卡所以須購買。 --- > 硬體組撰寫 ## 2022/10/30 > 軟體組 pca 9695 code 可嘗試 ```arduino= #include <Wire.h> #include <Adafruit_PWMServoDriver.h> Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); // Initiates library. #define SERVOMIN 100 // Minimum pulse length count out of 4096. #define SERVOMAX 2200 // Maximum pulse length count out of 4096. int servoNo = 0; // Defines a counter for servos. void setup() { Serial.begin(9600); // Starts serial connecton at 9600 baud rate. pwm.begin(); // Sends PWM signals. pwm.setPWMFreq(60); // Makes servos run at 60 Hz rate. delay(20); } void loop(){ for (int pulselen = SERVOMIN; pulselen < SERVOMAX; pulselen++) // Drives each servo one at a time first pwm.setPWM(servoNo, 0, pulselen); // to maximum pulse length then to minimum pulse length. delay(300); for (int pulselen = SERVOMAX; pulselen > SERVOMIN; pulselen--) pwm.setPWM(servoNo, 0, pulselen); delay(300); servoNo ++; // Proceeds to next servo. if (servoNo > 3) servoNo = 0; } ``` --- ## 2022/11/8 > 硬體組 ![](https://i.imgur.com/nZtGIkM.png) ![](https://i.imgur.com/TM8HOzY.png) ![](https://i.imgur.com/tvvJbhT.jpg) ![](https://i.imgur.com/bMNyvya.png) ## 2022/11/17 輪子方向[參考](https://blog.csdn.net/weixin_36815313/article/details/108836458) rosserial[參考](https://www.twblogs.net/a/5d40f745bd9eee5174232a44#:~:text=rosseria,%E5%8F%96ROS%E7%B3%BB%E7%B5%B1%E6%99%82%E9%96%93) > 軟體組 ```arduino= #define UPPER_LEFT_CLK 1 // 有脈衝時運轉 #define UPPER_LEFT_CW 2 // 高電壓時逆時針 #define LOWER_LEFT_CLK 3 #define LOWER_LEFT_CW 4 #define UPPER_RIGHT_CLK 5 // 有脈衝時運轉 #define UPPER_RIGHT_CW 6 // 方向 #define LOWER_RIGHT_CLK 7 #define LOWER_RIGHT_CW 8 #define CLOCK HIGH #define ANTI_CLOCK LOW int Distance = 0; // Record the number of steps we've taken void forward(); void setup() { pinMode(8, OUTPUT); pinMode(9, OUTPUT); digitalWrite(8, LOW); digitalWrite(9, LOW); } void loop() { digitalWrite(9, HIGH); delayMicroseconds(100); digitalWrite(9, LOW); delayMicroseconds(100); Distance = Distance + 1; // record this step // Check to see if we are at the end of our move // two rotation for 1/8 bridge and 1 rotation for 1/6 bridge (for this code) if (Distance == 3200) { // We are! Reverse direction (invert DIR signal) if (digitalRead(8) == LOW) { digitalWrite(8, HIGH); } else { digitalWrite(8, LOW); } // Reset our distance back to zero since we're // starting a new move Distance = 0; // Now pause for half a second delay(500); } } void forward() { digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_LEFT_CW, CLOCK ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CW, CLOCK ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CW, CLOCK) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CW, CLOCK) ; } ``` 11/18 轉動測試 ```arduino= #define UPPER_LEFT_CLK 3 // 有脈衝時運轉 #define UPPER_LEFT_CW 2// 高電壓時逆時針 #define LOWER_LEFT_CLK 9 #define LOWER_LEFT_CW 8 #define UPPER_RIGHT_CLK 5 // 有脈衝時運轉 #define UPPER_RIGHT_CW 4 // 方向 #define LOWER_RIGHT_CLK 7 #define LOWER_RIGHT_CW 6 #define CLOCK HIGH #define ANTI_CLOCK LOW int Distance = 0; // Record the number of steps we've taken void forward(); void setup() { pinMode(UPPER_LEFT_CLK, OUTPUT); pinMode(UPPER_LEFT_CW, OUTPUT); pinMode(LOWER_LEFT_CLK, OUTPUT); pinMode(LOWER_LEFT_CW, OUTPUT); pinMode(UPPER_RIGHT_CLK, OUTPUT); pinMode(UPPER_RIGHT_CW, OUTPUT); pinMode(LOWER_RIGHT_CLK, OUTPUT); pinMode(LOWER_RIGHT_CW, OUTPUT); digitalWrite(UPPER_LEFT_CLK, LOW); digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CLK, LOW); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CLK, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CLK, LOW); digitalWrite(LOWER_RIGHT_CW, LOW); } void loop() { forward(); delay(1000); digitalWrite(UPPER_LEFT_CLK, LOW); digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CLK, LOW); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CLK, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CLK, LOW); digitalWrite(LOWER_RIGHT_CW, LOW); } void forward() { digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_LEFT_CW, CLOCK ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CW, CLOCK ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CW, CLOCK) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CW, CLOCK) ; } ``` 11/20 ```arduino= #define UPPER_LEFT_CLK 4 // steppin #define UPPER_LEFT_CW 5// dirpin #define LOWER_LEFT_CLK 8 #define LOWER_LEFT_CW 9 #define UPPER_RIGHT_CLK 2 #define UPPER_RIGHT_CW 3 #define LOWER_RIGHT_CLK 6 #define LOWER_RIGHT_CW 7 // #define stepsPerRevolution 1600 #define stepsPerRevolution 200 int Distance = 0; // Record the number of steps we've taken void forward(); void left(); void back(); void right(); void setup() { pinMode(UPPER_LEFT_CLK, OUTPUT); pinMode(UPPER_LEFT_CW, OUTPUT); pinMode(LOWER_LEFT_CLK, OUTPUT); pinMode(LOWER_LEFT_CW, OUTPUT); pinMode(UPPER_RIGHT_CLK, OUTPUT); pinMode(UPPER_RIGHT_CW, OUTPUT); pinMode(LOWER_RIGHT_CLK, OUTPUT); pinMode(LOWER_RIGHT_CW, OUTPUT); } void loop() { forward(); delay(1000); // left(); // delay(1000); // back(); // delay(1000); // right(); // delay(1000); } void forward() { int t =240; digitalWrite(UPPER_LEFT_CW, HIGH); digitalWrite(UPPER_RIGHT_CW, HIGH); digitalWrite(LOWER_LEFT_CW, HIGH); digitalWrite(LOWER_RIGHT_CW, HIGH); digitalWrite( UPPER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); } void left() { int t =500; digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CW, HIGH); digitalWrite(LOWER_LEFT_CW, HIGH); digitalWrite(LOWER_RIGHT_CW, LOW); for (int i = 0; i < stepsPerRevolution; i++) { digitalWrite( UPPER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); } } void right() { int t =500; digitalWrite(UPPER_LEFT_CW, HIGH); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CW, HIGH); for (int i = 0; i < stepsPerRevolution; i++) { digitalWrite( UPPER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); } } void back() { int t =500; digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CW, LOW); for (int i = 0; i < stepsPerRevolution; i++) { digitalWrite( UPPER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_LEFT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( LOWER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); } } ``` jetson & arduino 連動 ``` arduino = #define UPPER_LEFT_CLK 4 // steppin #define UPPER_LEFT_CW 5// dirpin #define LOWER_LEFT_CLK 8 #define LOWER_LEFT_CW 9 #define UPPER_RIGHT_CLK 2 #define UPPER_RIGHT_CW 3 #define LOWER_RIGHT_CLK 6 #define LOWER_RIGHT_CW 7 // #define stepsPerRevolution 1600 #define stepsPerRevolution 200 int Distance = 0; // Record the number of steps we've taken int t = 1000 ; // 600 - 1200 void forward(); void left(); void back(); void right(); void setup() { Serial.begin(115200); pinMode(UPPER_LEFT_CLK, OUTPUT); pinMode(UPPER_LEFT_CW, OUTPUT); pinMode(LOWER_LEFT_CLK, OUTPUT); pinMode(LOWER_LEFT_CW, OUTPUT); pinMode(UPPER_RIGHT_CLK, OUTPUT); pinMode(UPPER_RIGHT_CW, OUTPUT); pinMode(LOWER_RIGHT_CLK, OUTPUT); pinMode(LOWER_RIGHT_CW, OUTPUT); } void loop() { // char command; // if( Serial.available() ) // { // command = Serial.read(); // if( 'w' == command ) forward(); // else if( 'a' == command ) left(); // else if( 's' == command ) back(); // else if( 'd' == command ) right(); // } forward(); } void forward() { digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CW, HIGH); digitalWrite(LOWER_LEFT_CW, HIGH); digitalWrite(LOWER_RIGHT_CW, LOW); digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; digitalWrite( LOWER_LEFT_CLK, LOW ) ; digitalWrite( UPPER_RIGHT_CLK, LOW ) ; digitalWrite( LOWER_RIGHT_CLK, LOW ) ; delayMicroseconds(t); } void left() { digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CW, HIGH); digitalWrite(LOWER_LEFT_CW, HIGH); digitalWrite(LOWER_RIGHT_CW, LOW); digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; digitalWrite( LOWER_LEFT_CLK, LOW ) ; digitalWrite( UPPER_RIGHT_CLK, LOW ) ; digitalWrite( LOWER_RIGHT_CLK, LOW ) ; } void right() { digitalWrite(UPPER_LEFT_CW, HIGH); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CW, HIGH); digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; digitalWrite( LOWER_LEFT_CLK, LOW ) ; digitalWrite( UPPER_RIGHT_CLK, LOW ) ; digitalWrite( LOWER_RIGHT_CLK, LOW ) ; } void back() { digitalWrite(UPPER_LEFT_CW, LOW); digitalWrite(UPPER_RIGHT_CW, LOW); digitalWrite(LOWER_LEFT_CW, LOW); digitalWrite(LOWER_RIGHT_CW, LOW); digitalWrite( UPPER_LEFT_CLK, HIGH ) ; digitalWrite( LOWER_LEFT_CLK, HIGH ) ; digitalWrite( UPPER_RIGHT_CLK, HIGH ) ; digitalWrite( LOWER_RIGHT_CLK, HIGH ) ; delayMicroseconds(t); digitalWrite( UPPER_LEFT_CLK, LOW ) ; digitalWrite( LOWER_LEFT_CLK, LOW ) ; digitalWrite( UPPER_RIGHT_CLK, LOW ) ; digitalWrite( LOWER_RIGHT_CLK, LOW ) ; } ``` https://www.796t.com/content/1546502966.html [jetson nano ubuntu 20.04(可用python3.8)](https://github.com/Qengineering/Jetson-Nano-Ubuntu-20-image) [Install-OpenCV-Jetson-Nano](https://github.com/Qengineering/Install-OpenCV-Jetson-Nano) [Install OpenCV 4.5 on Jetson Nano](https://qengineering.eu/install-opencv-4.5-on-jetson-nano.html) https://hackmd.io/@0p3Xnj8xQ66lEl0EHA_2RQ/Skoa_phvB#%E5%AE%89%E8%A3%9D-jetson-inference https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048 https://qengineering.eu/install-pytorch-on-jetson-nano.html https://chiachun0818.medium.com/jetson-nano-%E9%87%8D%E6%96%B0%E7%B7%A8%E8%AD%AF-opencv-cuda-a65daf5988ab https://stackoverflow.com/questions/65631801/illegal-instructioncore-dumped-error-on-jetson-nano https://hackmd.io/@RhXjjdqWRia5PGZ7tfsfnQ/SJQJ3dMZq https://cloudbytes.dev/snippets/upgrade-python-to-latest-version-on-ubuntu-linux https://ithelp.ithome.com.tw/articles/10300518 https://stackoverflow.com/questions/49940813/pip-no-module-named-internal https://d246810g2000.medium.com/nvidia-jetson-nano-for-jetpack-4-4-01-%E7%92%B0%E5%A2%83%E5%AE%89%E8%A3%9D-fd48d5658a13 https://blog.csdn.net/qq_51401897/article/details/119861877 https://www.reddit.com/r/learnpython/comments/rdxjlh/pip3_broken_attributeerror_module_collections_has/ https://github.com/adafruit/Adafruit_Python_SSD1306