More Related Content
Similar to Unity3D with WF8266R : CH03 Setup with Unity3D (20)
Unity3D with WF8266R : CH03 Setup with Unity3D
- 12. 3-2 LED WEB
• API
• http://wf8266.com/wf8266r/docs/WebAPI
• GPIO
• http://ip/gpio?5=0
• http://ip/gpio?5=1
- 13. 3-2 LED Unity
• WF8266R
• WF8266R.cs
• Main Camera
• TAG
• WF8266RData.cs
• WF8266RConnetion.cs
- 14. 3-2 LED Unity
void OnCollisionEnter(Collision target){//當進入 撞
Debug.Log("OnCollisionEnter");
//取得target(撞到的目標)上的Script名稱
WF8266R wf8266r = (WF8266R)GameObject.FindWithTag("WF8266R").GetComponent("WF8266R");
if(gpio5==0)
gpio5 = 1;
else
gpio5 = 0;
wf8266r.value = "5,"+gpio5.ToString();
wf8266r.Send();
}