Code Monkey home page Code Monkey logo

hw4-ble-programming-peripheral's Introduction

hw4-BLE-programming-Peripheral

set up

1,先把https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-ble-Button/ 的檔案import到mbed os
2,裡頭的main.cpp 和 pretty_printer.h 用這個github的檔案取代,跟c++相關的其他檔案也import到source裡面
3,準備樹梅派,並在樹莓派環境裝好bluepy套件用來執行Ble_new.py用

run code

1,注意樹梅派裡頭BLE_new.py裡頭的31行,裡面的字串換成所要連的gatt server的藍芽mac位址,還有gatt server的位置特性(random或public)
2,先在mbed按執行之後,就可以讓stm32扮演gatt server的角色,再用樹梅派的ble.py來去獲取需要的服務,我們寫的是可以讓原本板子上不亮的led再執行後變成亮,達到peripheral控制led的效果
3,服務內容就會顯示在樹梅派的terminal 4,按stm32板子的按鈕可以啟用notify 切換顯示的學生id功能

reference

https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-ble-LED/

hw4-ble-programming-peripheral's People

Contributors

wei-xiang-dei avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.