# Remote Maker Asia - Arduino

## เริ่มต้นต้องติดตั้ง โปรแกรม KBIDE ก่อนตามลิงค์ด้านล่างเลย

{% content-ref url="/pages/-MPmw70lW75EmC0-twPJ" %}
[Arduino IDE Install](/getstart/arduino-ide-1.md)
{% endcontent-ref %}

### **ดาวน์โหลดตัวอย่าง Code Arduino**

ในตัวอย่างโปรแกรม Drone ในฝั่งของ Arduino IDE จะคล้ายกับ KBIDE เนื่องจากใช้ SDK ตัวเดียวกันจึงทำให้สามารถรันข้าม  Platform กันได้เริ่มต้น Download Code จากลิงค์ด้านล่างกันก่อนเลย

{% hint style="success" %}
[คลี๊กดาวน์โหลดตัวอย่างโปรแกรมโดรนบน Arduino IDE](https://github.com/MakerAsia/kb32-ft)
{% endhint %}

![](/files/-MdVyHTy0mpmrHFWyUtX)

สามารถกดปุ่มสีเขียว **Download "Code"** หลังจากนั้นแตกไฟล์ให้เรียบร้อยก็จะได้ SDK Drone Kit ที่พร้อมพัฒนากันแล้ว

![](/files/-MdW-Jc3-USDKih5IG7F)

ไฟล์ SDK Drone Kit จะมี Library ที่จำเป็นและถูกดัดแปลงมาให้สามารถใช้งานกับชุดคิทได้ จึงต้องใช้ Library ที่เราพัฒนาขึ้นมาเพื่อให้เจ้า Drone Kit มีความสามารถการบินที่ดีที่สุดบนบอร์ด KB32-FT

{% hint style="success" %}
**เปิดไฟล์ droneRemoteMA.ino**
{% endhint %}

![ภาพแสดงการสร้าง Folder](/files/-MaZ95-CMPWNT0wkH-8g)

เมื่อดับเบิ้ลคลิ๊กเปิดไฟล์เสร็จจะมี Popup เด้งให้สร้าง folder ขึ้นมาใหม่ ให้กด **"Cancel"** หรือ กด **"OK"** เพื่อสร้าง folder ใหม่แต่ต้องย้ายไฟล์ Library ตามเข้าไปใน folder ด้วย

{% hint style="info" %}
กด Cancel เพื่อไม่ต้องสร้าง folder ขึ้นมาให้ใช้ folder ให้ Libbrary อยู่ใน folder เดียวกัน
{% endhint %}

{% hint style="info" %}
กด OK เพิ่มสร้าง folder ขึ้นมาแต่จำเป็นต้องย้าย Libbrary ไปอยู่ใน folder เดียวกัน
{% endhint %}

![](/files/-MdW1e3MOil9ej1_0V2W)

{% hint style="warning" %}
เลือกบอร์ด ESP32 Dev Module และทดลองกด Compile ดูว่าโปรแกรมรันผ่านหรือไม่
{% endhint %}

{% hint style="success" %}
ใน ESP32 Version ถัดไปจะสามารถเลือกบอร์ด KB32-FT บน โปรแกรม Arduino IDE ได้แล้ว
{% endhint %}

### ตัวอย่างการคาริเบท DroneCal

ในขั้นตอนแรกตัวอย่างโปรแกรม DroneCal เป็นการเรียกอ่านค่าเริ่มต้นของเซนเซอร์ Accelerometer และ Gyroscope ของชิพ MPU-6050 ซึ่งใช้เป็นค่า offset ของโดรน&#x20;

#### ขั้นตอนแรกคาริเบท&#x20;

เริ่มต้นโดรนจะเข้าสู่โหมดเรียกอ่านค่าคาริเบทถ้าหากไม่มีการกดปุ่มใด ๆ โดรนจะใช้ค่าคาริเบทเดิมตามรูป

![](/files/-MdVqkJ5Lwh5K5_GY9rF)

![](/files/-MdVqmUEofPiHh3WYGjH)

![](/files/-MdW1vgRQdpU03K-5JG7)

{% hint style="warning" %}

### หากตอนเริ่มต้นมีการกดปุ่ม S1 ค้างไว้ โดรนจะเข้าสู่โหมดคาริเบท

{% endhint %}

![](/files/-MdVr9zM_Ww_NsTgB-30)

![](/files/-MdVrCkQVApdzSxl5KAK)

{% hint style="danger" %}

### `ในการคาริเบททุกครั้งจำเป็นต้องวางตัวโดรนให้ระนาบกับพื้นเรียบที่สุด`

{% endhint %}

เมื่อเปิดเมนู **Serial Monitor** แล้วตัวโปรแกรมจะแสดงค่า Accl , Gyro ของทั้ง 3 แกน จะมีทั้งหมด 6 ตัวแปร‌

![](/files/-MdW24O88wm5fiMrVXYS)

**ตัวอย่างค่าที่แสดงผล (เครื่องหมายลบ - ต้องพิมพ์ด้วย) ซึ่งโดรนแต่ละลำจะมีค่าที่อ่านได้ไม่เหมือนกัน**

| **X Accel** | **Y Accel** | **Z Accel** | **X Gyro** | **Y Gyro** | **Z Gyro** |
| ----------- | ----------- | ----------- | ---------- | ---------- | ---------- |
| -91         | 3637        | 1457        | -10        | -48        | -17        |

{% hint style="warning" %}

### **ใน App Remote Maker Asia นั้น ไม่จำเป็นต้องจำค่าคาริเบทตัว Drone จะบันทุกค่าลงบน  EEPROM ให้อัตโนมัติ**

{% endhint %}

{% hint style="success" %}
เมื่อกด Upload แล้วสามารถใช้ App RemoteXY มาต่อและใช้งานได้เลย
{% endhint %}

#### สำหรับการปรับปรุงแก้ไขตัวแปรต่าง ๆ ในระดับ Advance จะมีคอสสอนออนไลน์เร็ว ๆ นี้สามารถรอติดตามและเรียนกับทีมงานคุณภาพได้เลยรับรองว่าได้ความรู้พร้อมเทคนิคอีกมากมาย


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb32ft.makerasia.com/drone-kit/drone-developer/remote-maker-asia/remote-maker-asia-arduino.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
