shangrex
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- tags: course --- # MCU2020-Team11 組員:林霆寬 林政傑 鄭明奇 黃上睿 ## demo影片網址 https://www.youtube.com/watch?v=uj5qdnUJ2TQ&fbclid=IwAR2PPxpShFsccgLvTfzGrQjBsBfIR1cch3OvTtaIE7jzmlvFknxj-QwHLVM ## 系統功能與原理說明 系統主要是有兩個功能,一個是基於手部動作來偵測的遊戲,採用加速規測量手的動作。另一個是利用兩個可變電阻來模擬開車情境,一個可變電阻控制方向,一個控制加速度,並且盡力實現真實的情況,利用Unity做出摩擦力、輪子的控制等......其他的功能包括利用利用timer0來控制三位數七段顯示器和蜂鳴器。 ## 系統使用環境及對象 我們設計是給一些不愛運動同時也愛玩遊戲的人。在現代社會中,人類越來越懶惰,連出門買東西都成為了艱難的選擇。我們的遊戲可以在帶給人們歡樂的同時,也可以使他們運動。 更甚者,我們還可以模擬開車的情境,給不愛出門的人也可以享受開車的樂趣和欣賞戶外風景,希望可以減少路上三寶的數量。 ## 系統完整架構圖、流程圖、電路圖、設計 ### 遊戲流程圖 ![](https://i.imgur.com/Ma1xUhZ.png) ### 電路圖 * MCU1 (For communicating to Unity, and sensor, button, Variable Resistor connection) <br> ![](https://i.imgur.com/vZbc6zH.png) ![](https://i.imgur.com/dPRmrlD.jpg) * MCU2 (For Buzzer, Seven-segment display connection) <br> ![](https://i.imgur.com/tkuCdIM.png) ![](https://i.imgur.com/Lin0Sl4.jpg) * 降壓電路 (5V to 3V) <br> ![](https://i.imgur.com/DPN98oB.png) <br> ![](https://i.imgur.com/eGN9Vg3.jpg) ## 系統開發材料及技術 * 加速規 (ADXL335) * 三位數七段顯示器 (C-563G-12) * 按鈕 * 可變電阻x2 * 蜂鳴器 ### 開發工具 * Unity * MPLAB * Pickit ## 周邊接口或 Library 及 API 使用說明 * C# API: System.IO.Ports.SerialPort Unity2D ## 實際組員之分工項目 Unity遊戲開發: 鄭明奇、黃上睿 MCU和Unity連線 & 可變電阻 & 按鈕: 林政傑 加速規: 林霆寬、黃上睿 三位數七段顯示器: 林霆寬 Timer: 鄭明奇 ## 遇到的困難及如何解決 **問題:** 加速規和 Pickit 做 SPI 連線時,連不起來,並且在一次的測試中把他給燒掉。 **解法:** 我們重新買一個不是用 SPI 介面的加速規,改用 ADC 讀加速規的值。 --- **問題:** 我們的三位數七段顯示器沒有Datasheet。 **解法:** 隊員找到其他型號的 Datasheet ,並研究出每個腳位的正確編號,並去揣測他的運作模式,最後確認顯示器的電路為共陰極,成功實現計時器。 --- **問題:** 買的加速規沒有焊接,在移動的過程中會脫線,不夠穩定。 **解法:** 尋求實驗室的幫助,和實驗室學長借焊槍焊錫自己焊。 --- **問題:** PIC18 腳位不夠接七段顯示器加其他元件 **解法:** 用第二個 PIC18 來接七段顯示器 --- **問題:** 兩個 PIC18 無法互相溝通 **解法:** 電位問題,將其中一個 PIC18 的供電拔掉並且將供電和另一個 PIC18 串聯。因為PIC18 device的供電電壓只能確保相對電位差,所以在兩片連接時沒辦法確定兩邊的電壓是一樣的。所以只能有一個電源。 --- **問題:** UART有時候會沒有傳輸 **解法:** 重開MPLAB --- ## 單元項目舉例:(皆須在系統文件中詳細說明) * Interrupt * 按鈕 * Timer * 小恐龍計數器得分(七段顯示器) * 蜂鳴器的鳴叫 * UART * pickit和電腦間的傳輸 * ADC * 可變電阻控制車子的方向,以及控制主選單的按鈕 * 加速規 * 選單的控制 ## 進階單元項目舉例:(皆須在系統文件中做詳細說明) * 演算法 * 我們在Pickit運算的過程中沒有使用乘法,盡量用簡單的運算達成或是搭配簡單的左移右移。 * 磨擦力是利用可變電阻的值去模擬,而不是利用Unity的遊戲引擎去模擬。 * 軟體 * 使用Unity來做大量的運算,比如光線、渲染 * 創新性 * 模擬開車的情境,車子使用wheel object來做移動以增進真實的模擬程度,並且使用兩個可變點組去模擬開車的情境,一個可以當方向盤,一個當腳煞車。 * 以加速規來控制遊戲角色的跳躍和蹲下,兼顧新穎的趣味性和運動功能。 * 選單的選擇是利用可變電阻和按鈕做選擇 * 整合性 * 我們在運行主程式的麵包版上接了兩顆可變電阻和一個按鈕,並且可以將 RB0 連接到另一塊裝有七段顯示器及蜂鳴器的麵包版上,將 AN2 接上。 * 整合了四個上課有教過的功能,同時放在兩個不同的pic18上並使其可以溝通。

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully