# Kirim Data Sederhana ke Antares

Berikut merupakan *source code* untuk menghubungkan Arduino Uno Ethernet Shield dengan Antares menggunakan Arduino IDE.

Setelah Anda selesai melakukan konfigurasi, saatnya membuat kode program untuk mengirim data sederhana ke device pada console Antares yang telah Anda buat sebelumnya. Kode Program dapat Anda dapatkan di direktori example pada folder library Antares Ethernet Shield yang telah Anda download sebelumnya atau dengan mudah Anda dapatkan dengan klik **File > Examples > AntaresEthernetShield > Send\_Data** pada Arduino IDE.

Kode program AntaresEthernetShield seperti berikut. Jangan lupa untuk ketik Access Key applicationname dan Device Id yang Anda gunakan pada console Antares akun Anda. Setelah itu upload program dan tunggu beberapa detik.

{% code lineNumbers="true" %}

```c
#include "AntaresEthernetShield.h"

#define ACCESSKEY "your-access-key"
#define applicationName "your-application-name"
#define deviceName "your-device-name"

unsigned int counter =0;

AntaresEthernetShield antares(ACCESSKEY);

void setup() {
Serial.begin(9600);
antares.StartConnection();
}
void loop() { 
String text ="Hello! ";
text += String(counter);
counter++;
antares.sendData(text, applicationName, deviceName);
delay(10000);
}            
```

{% endcode %}

Setelah proses upload kode program selesai, silahkan periksa data yang masuk pada Device Antares yang telah Anda buat sebelumnya. Jika berhasil maka tampilan pada Device Anda akan seperti berikut ini:

<figure><img src="/files/YcGz4k2RGecx8ZWRsBb9" alt=""><figcaption></figcaption></figure>


---

# 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://docs.antares.id/contoh-kode-dan-library/arduino-uno/kirim-data-sederhana-ke-antares.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.
