LoginSignup
1
1

More than 3 years have passed since last update.

ArduinoIDE インストールして ESP32 使って LED 光らせるまで

Last updated at Posted at 2019-09-15

2019年9月16日時点のインストール記録です。

環境

マイコンボード

Esp32 DevKit v1 を使います。
IMG_20190916_011623.jpg

似たボードはいろんなものがあります。

IMG_20190916_012635.jpg

この写真では、左が WEMOS32、真ん中がESP32 DevKit V1、右が ESP32 DevKitCです。

ほぼ同じようなものとして使用できます。

PC

原稿はUbuntu 18.04Linuxにインストールしていますが、windowsやMacも同様に設定できます。

IMG_20190916_013252.jpg

その他

  • 470Ω(黃紫茶金)抵抗
  • LED
  • ブレッドボード
  • ブレッドケーブル

Arduino IDE 設定

ダウンロード

image.png

「SOFTWARE」-「DOWNLOADS」

image.png

いろいろありますが、Downloadバージョンを使います。
更に、Windowsの方は「Windows ZIP」を選んでください。

「JUST DOWNLOAD」
- Windowsの方はarduino-1.8.10-windows.zip
- Macの方はarduino-1.8.10-macosx.zip
- Linuxの方はarduino-1.8.10-linux64.tar.xz
をダウンロードすることになります。

解凍

自分の都合のいいところに解凍します。

Portable環境として設定する

解凍場所に「portable」というフォルダを作ります

image.png

追加インストール

Linuxの場合はフォルダ内に入っている install.sh を実行します。

Arduino IDE 起動

以下の画面が起動します。

image.png

以下のサイトを開き、

image.png

jsonファイルのURLをコピーします。

「ファイル」-「環境設定」で「追加のボードマネジャのURL」に先程のURLを入力します。

image.png

ついでに、「より詳細な情報を表示する」も「コンパイル」、「書き込み」のチェックをつけておきましょう。

「ツール」ー「ボード」ー「ボードマネジャ...」から、
ESP32と入力して出てきた「esp32 for Espressif Ststems」を選び、インストールします。
image.png

ボードの定義やツールをダウンロードするのに時間がかかるので、注意。
うまくいったら

「ツール」ー「ボード」を「ESP32 Dev Module」にします。
image.png

接続する

microUSBケーブルでESP32ボードをつなげます。

「ツール」ー「シリアルポート」でポートを選択します。
どのポートがESP32かは、ESP32ボードを外した/取り付けたときにどのポートに変化があるかでチェックします。

もし、ポートに変化が無い場合-> TroubleShooting

LEDチカチカその1

ESP32 DevKit V1 の場合はオンボードLEDが使えます。(その他のボードの場合は## LEDチカチカその2に進んでください)

このようにプログラムを作ります。

image.png

実行すると青いLEDが点滅します。
IMG_20190916_021744.jpg

LEDチカチカその2

ブレッドボードを使って回路を作ってみましょう。
IMG_20190916_013832.jpg

IMG_20190916_013925.jpg

回路ができたら、上記のプログラムの「2」となっているところを「13」としてプログラムを作り、書き込みます。

うまくいきましたか?
IMG_20190916_022139.jpg

trouble shooting

はドライバをインストールする必要があります。

Linux


  File "/media/ubuntu/39f999be-7817-43e5-bee9-e41852a42fdd/arduino-1.8.10_ESP32/portable/packages/esp32/tools/esptool_py/2.6.1/esptool.py", line 37, in <module>
    import serial
ImportError: No module named serial
exit status 1
ボードESP32 Dev Moduleに対するコンパイル時にエラーが発生しました。

please install pyserial


$ sudo apt install pyserial

but,sometimes, can not install...
So, install by dpkg.
from download https://packages.ubuntu.com/bionic-updates/all/python/


python-pip-whl_9.0.1-2.3~ubuntu1.18.04.1_all.deb
python-pip_9.0.1-2.3~ubuntu1.18.04.1_all.deb



$ sudo dpkg -i python-pip_9.0.1-2.3~ubuntu1.18.04.1_all.deb python-pip-whl_9.0.1-2.3~ubuntu1.18.04.1_all.deb 


$ pip install pyserial

必要に応じ、dialoutグループに自分のユーザを追加し、再起動します。

Windows

WindowsUpdateを行ってください。

Mac

Please install Driver.
https://jp.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers

cf.,
CP210x USB to UART Bridge VCP Drivers を Mac OS にインストールする方法
https://qiita.com/bluemooninc/items/2c7d044ab61e6ae6cc1e

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1