---
title: #1Atomfly_control_programming
tags: 
author: [伊藤恒平](https://convert.docswell.com/user/Kouhei_Ito)
site: [Docswell](https://www.docswell.com/)
thumbnail: https://bcdn.docswell.com/page/K746DG9RE1.jpg?width=480
description: #1Atomfly_control_programming by 伊藤恒平
published: December 16, 22
canonical: https://convert.docswell.com/s/Kouhei_Ito/57QRGK-2022-12-16-212047
---
# Page. 1

![Page Image](https://bcdn.docswell.com/page/K746DG9RE1.jpg)

AtomFly Motor Control
AtomFly Control Programming #1


# Page. 2

![Page Image](https://bcdn.docswell.com/page/LJ1VZDKVEG.jpg)

AtomFly Pin Assign
Front Left
G22
Front Right
G19
G23
Rear Left
G33
Rear Right
Front Left G22
Front Right G19
Rear Left G23
Rear Right G33
I2C SCL G21（クロック）
I2C SDAG25（データ）


# Page. 3

![Page Image](https://bcdn.docswell.com/page/GJWL9YD3E2.jpg)

About PWM Control
Duty
ON
OFF
周期
Period


# Page. 4

![Page Image](https://bcdn.docswell.com/page/4EZM9XGGJ3.jpg)

Functions of PWM control
セットアップ
0〜15
Duty100%を2
の何乗にする
かを決める
uint32_t ledcSetup(uint8_t chan, uint32_t freq, uint8_t bit_num);
使⽤するピンとチャンネルの割り当て
void ledcAttachPin(uint8_t pin, uint8_t chan);
Dutyの変更
void ledcWrite(uint8_t chan, uint32_t duty);


# Page. 5

![Page Image](https://bcdn.docswell.com/page/Y76NK4YQ7V.jpg)

How to make the simple project
(1)


# Page. 6

![Page Image](https://bcdn.docswell.com/page/G755PQG274.jpg)

How to make the simple project
(2)


# Page. 7

![Page Image](https://bcdn.docswell.com/page/9J2N6PY1ER.jpg)

How to make the simple project
(3)
(4)
(5)
(6)


# Page. 8

![Page Image](https://bcdn.docswell.com/page/DEYP95G4EM.jpg)

How to make the simple project
(7)


# Page. 9

![Page Image](https://bcdn.docswell.com/page/VJN5LNG678.jpg)

How to make the simple project
#include &lt;M5Atom.h&gt;


# Page. 10

![Page Image](https://bcdn.docswell.com/page/YE9Y4RWRJ3.jpg)

Build
Push check Icon


# Page. 11

![Page Image](https://bcdn.docswell.com/page/GE86QWNG7D.jpg)

Upload to M5Atom
Push arrow Icon


# Page. 12

![Page Image](https://bcdn.docswell.com/page/LEL9XNPXJR.jpg)

Install FTDI driver
If you can not upload to M5Atom…….
Download and Install


