1.電路圖
2.設定參數
3.輸出波型
本社群由Nantou.py使用者社群以及國立虎尾科技大學電機資訊學院負責維護,它是一群熱愛智慧生活科技以及Python的專業教師所組成,大家一同快樂地研究有關數位生活中人工智慧、大數據、物聯網、雲端服務、APPS、福祉科技、感知網路服務、車載網路服務、及網際網路等資通訊技術,並運用這些資通訊以及Python技術來提升我們的日常生活品質,建立更好的生活環境。
2.HIVEMQ: https://www.mqtt-dashboard.com/
3.MQTT example:人物動作控制
4.Publish
Topic:AnimationCommand
Commands: Idle, Walking, Running, Dance, Death, Sitting, Standing, Jump, Yes, No, Wave, Punch, ThumbsUp
5.Subscribe:
Topic: AnimtionState
In the upper right corner of the picture above, we can see two light control buttons are 'toggle directional light' and 'toggle hemisphere light', separately. You can try it out and learn how the two different lights work. For directional light, it is used to gets emitted in a specific direction but the light source of the hemisphere light position is located directly above the scene and the color of the light will gradually change from the color of the sky to the color of the ground.
1. three.js example: three.js examples (threejs.org)
2.MQTT example:Light Control
3.Publish
Topic:LightControlinHTML
Command 1:toggleHemisphereLight
Command 2:toggleDirectionalLight
4.Subscribe:
Topic: LightControl
We use MQTTBOX to test the issuance of commands as follows.
Host:test.mosquitto.org
Protocol:mqtt/tcp
資料網站:臺中市列冊獨居老人人數及服務概況
資料格式:臺中市列冊獨居老人人數及服務概況_JSON
1.首先下載資料,並改名為JSON.json。
2.撰寫下列基本程式:
1 2 3 4 5 | import json f = open('JSON.json') data = json.load(f) print(data) f.close() |
1 2 3 4 5 | import json f = open('JSON.json', encoding="utf-8") data = json.load(f) print(data) f.close() |
1 2 3 4 5 6 7 8 9 | import json f = open('JSON.json', encoding="utf-8") data = json.load(f) data = data['ROOT']['RECORD'] for d in data: for r in d: print(r, ":", d[r]) print("\n") f.close() |
1 2 3 4 5 6 7 8 9 10 11 12 | import json f = open('JSON.json', encoding="utf-8") data = json.load(f) data = data['ROOT']['RECORD'] for d in data: for r in d: if r == "行政區" : print(d[r]) if r == "合計": print(d[r]) print("\n") f.close() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import json f = open('JSON.json', encoding="utf-8") X=[] Y=[] data = json.load(f) data = data['ROOT']['RECORD'] for d in data: for r in d: if r == "行政區" : X.append(d[r]) if r == "合計": Y.append(d[r]) f.close() import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['mingliu'] plt.plot(X, Y) plt.ylabel('(人)') plt.show() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | import json f = open('JSON.json', encoding="utf-8") X=[] Y=[] data = json.load(f) data = data['ROOT']['RECORD'] for d in data: for r in d: if r == "行政區" : X.append(d[r]) if r == "合計": Y.append(int(d[r])) f.close() import matplotlib.pyplot as plt plt.rcParams['font.sans-serif'] = ['mingliu'] plt.plot(X, Y) plt.ylabel('(人)') plt.show() |