> For the complete documentation index, see [llms.txt](https://huenit.gitbook.io/huenit-edu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huenit.gitbook.io/huenit-edu/huenit/huenit-lab/4./4.1-ai/3.1.0..md).

# 3.1.0. 준비하기

{% hint style="info" %}

### AI 카메라 펌웨어 업데이트

[펌웨어 확인 및 업데이트](/huenit-edu/huenit/huenit-lab/0..md#undefined-3)를 보고 AI 카메라의 펌웨어를 최신버전으로 유지한다. \
AI 카메라 펌웨어 최신 버전 : V1.0.7
{% endhint %}

### PC에 AI 카메라 연결하기

AI 카메라의 C-type 포트로 PC에 다음과 같이 연결한다.&#x20;

<figure><img src="/files/GGcmCBTgAKWPqIIK1n1H" alt=""><figcaption><p>AI카메라를 PC와 연결한 모습</p></figcaption></figure>

***

### \[코드(Code)]탭에서 AI 카메라 연결

블록코딩 프로젝트를 생성하여 AI 카메라 인식 및 연결 방법에 대해서 알아보자.&#x20;

1. PC에 AI 카메라를 연결하면 다음과 같이 HUENIT LAB-\[코드] 탭에서 AI 카메라가 인식된다.

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

2. HUENIT LAB에서 **\[연결하기]**&#xBC84;튼을 클릭하여 카메라를 연결합니다.

※ AI 카메라를 USB 케이블을 사용하여 연결하지 않으면HUENIT LAB에서 **\[연결하기]** 버튼이 보이지  않습니다.

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

연결이 제대로 되면 다음과 같이 코딩에 필요한 버튼이 활성화 된다.

<figure><img src="/files/5Tg7J4FwVbgMIWGhilgp" alt="" width="375"><figcaption></figcaption></figure>

***

### 1. 코드 실행

#### 코드 실행 방법(1) - PC에 연결을 유지하면서 코드 결과를 확인하는 방법

* 완성된 코드를 확인하기 위해서 <mark style="color:purple;">**`라이브(Live)`**</mark> 버튼을 누른다.&#x20;

<figure><img src="/files/XwVAxtVQPAJs9Zxfmdek" alt="" width="350"><figcaption></figcaption></figure>

* <mark style="color:purple;">**`Live`**</mark> 코드 실행 도중 멈추기 위해서 <mark style="color:red;">**`정지(STOP)`**</mark> 버튼을 누른다.&#x20;

<figure><img src="/files/natXcYmIpHgviM7YIoRH" alt="" width="350"><figcaption></figcaption></figure>

***

#### 코드 실행 방법(2) - 카메라에 코드를 저장하여 실행하는 방법

{% hint style="info" %}
주로 **카메라를 로봇에 연결하여 코드를 실행할 때 사용하는 방법**이다. \
AI 카메라를 노트북에 연결한 상태에서 로봇에 연결할 수 없기 때문에 다음과 같은 방법을 사용해야 한다.&#x20;
{% endhint %}

1. 완성된 코드를 HUENIT AI 카메라에 저장하기 위해서 <mark style="color:purple;">**`업로드(Upload)`**</mark> 버튼을 누른다.&#x20;

※  업로드 버튼 클릭 시, 코드가 카메라에 저장된다. 이 코드는 <mark style="color:purple;">**`라이브(Live)`**</mark> 버튼처럼 바로 실행되지 않는다.&#x20;

<figure><img src="/files/YRyZWp7bjmuLJz9anvD9" alt="" width="350"><figcaption></figcaption></figure>

2. 업로드한 코드는 <mark style="color:orange;">AI 카메라의 버튼</mark>을 2초간 꾹 눌러서 코드를 실행시킨다.&#x20;

<figure><img src="/files/e3TF3SFRqf1nEB92Xpdm" alt=""><figcaption><p>업로드한 코드 실행 방법</p></figcaption></figure>

3. 초기 HUENIT OS 화면으로 돌아오고 싶으면 <mark style="color:orange;">AI 카메라의 전원(리셋)버튼</mark>을 누르면 된다.

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

***

### 2. AI 카메라 초기화

* AI 카메라에 기존 코드가 작성되어 있는 경우에 이를 초기화 하기 위해서 <mark style="color:purple;">**`리셋(reset)`**</mark> 버튼을 누른다.&#x20;

<figure><img src="/files/fIfQS3NpwXljnzb7Qbkw" alt="" width="350"><figcaption></figcaption></figure>
