|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 653 KiB |
@@ -1,37 +1,48 @@
|
||||
# Usage
|
||||
|
||||
.. code:: python
|
||||
|
||||
Mic API
|
||||
********
|
||||
|
||||
-----------------------------
|
||||
|
||||
Function
|
||||
---------
|
||||
|
||||
---------------------
|
||||
|
||||
Usage
|
||||
------
|
||||
|
||||
.. code:: python
|
||||
|
||||
from m5stack import *
|
||||
import machine, _thread
|
||||
import machine, _thread
|
||||
|
||||
mic_adc = 0
|
||||
buffer = []
|
||||
def microphone_enter():
|
||||
def microphone_enter():
|
||||
print('microphone_enter')
|
||||
global mic_adc, buffer
|
||||
try:
|
||||
mic_adc = machine.ADC(34)
|
||||
global mic_adc, buffer
|
||||
try:
|
||||
mic_adc = machine.ADC(34)
|
||||
mic_adc.atten(mic_adc.ATTN_11DB)
|
||||
dac = machine.DAC(machine.Pin(25))
|
||||
dac.write(0)
|
||||
except:
|
||||
except:
|
||||
pass
|
||||
buffer = []
|
||||
for i in range(0, 55):
|
||||
for i in range(0, 55):
|
||||
buffer.append(0)
|
||||
|
||||
|
||||
def microphone_loop():
|
||||
def microphone_loop():
|
||||
global mic_adc, buffer
|
||||
val = 0
|
||||
for i in range(0, 32):
|
||||
for i in range(0, 32):
|
||||
raw = (mic_adc.readraw() - 1845) // 10
|
||||
if raw > 20:
|
||||
raw = 20
|
||||
elif raw < -20:
|
||||
raw = -20
|
||||
val += raw
|
||||
val += raw
|
||||
val = val // 32
|
||||
buffer.pop()
|
||||
buffer.insert(0, val)
|
||||
@@ -41,5 +52,5 @@
|
||||
|
||||
microphone_enter()
|
||||
|
||||
while 1:
|
||||
while 1:
|
||||
microphone_loop()
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# How to
|
||||
@@ -16,46 +16,26 @@ Driver <https://www.silabs.com/documents/public/software/Mac_OSX_VCP_Driver.zip>
|
||||
As the disk image SiLabsUSBDriverDisk.dmg is downloaded, mount it.
|
||||
Proceed according to the instructions OK.
|
||||
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/macOS_CP2104_dmg.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/macOS_CP2104_dmg.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/macOS_CP2104_pkg.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/macOS_CP2104_pkg.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/2.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/2.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/3.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/3.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/4.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/4.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/5.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/5.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/6.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/6.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/7.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/7.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/8.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/8.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/9.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/9.png
|
||||
|
||||
image
|
||||
2. Check port on MacOS
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -82,24 +62,16 @@ Driver <https://www.silabs.com/products/development-tools/software/usb-to-uart-b
|
||||
Choice the version of USB driver according to your windows
|
||||
version(Windows7/8/10).
|
||||
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/windows_download_CP2104_USB_driver.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/windows_download_CP2104_USB_driver.png
|
||||
|
||||
image
|
||||
Choice the right version installer(x64/x86), and install it.
|
||||
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver01.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver01.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver02.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver02.png
|
||||
|
||||
image
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver03.png
|
||||
:alt: image
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/windows_install_usb_driver03.png
|
||||
|
||||
image
|
||||
2. Check port on Windows
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -109,8 +81,4 @@ disappears from the list and then shows back again.
|
||||
|
||||
Figures below show serial port for M5Stack Core board
|
||||
|
||||
.. figure:: ../../_static/getting_started_pics/establish_serial_connection/windows_m5stack_in_device_manager.png
|
||||
:alt: image
|
||||
|
||||
image
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/establish_serial_connection/windows_m5stack_in_device_manager.png
|
||||
|
||||
@@ -4,6 +4,51 @@ This article will guide you how to burn a right firmware to your board.
|
||||
|
||||
### For MacOS
|
||||
|
||||
|
||||
***(Coming soon...)***
|
||||
|
||||
### For Windows
|
||||
|
||||
#### 1. Download M5Burner
|
||||
|
||||
For downloading M5Burner, visit the [offical website](http://www.m5stack.com) please.
|
||||
|
||||

|
||||
|
||||
#### 2. Burn the firmware
|
||||
|
||||
Unpack the M5Burner tool which you donwloaded for official website just now in any folder, then execute the executable file `M5Burner.exe`.
|
||||
|
||||

|
||||
|
||||
|
||||
**Then choice the `serial port` which is connected with your board and the `Baud` which is 921600 following below steps.**
|
||||
|
||||

|
||||
|
||||
**1. Choice a right firmware**
|
||||
|
||||
a. select `M5Flow-vx.x` option, if you want to program with [M5Flow](http://flow.m5stack.com)
|
||||
|
||||
b. select `M5Cam-vx.x (/M5Cam-psram)` option, if you own a ESP32CAM (/ M5CAMERA)
|
||||
|
||||
**2. Click `Erase`**
|
||||
|
||||

|
||||
|
||||
*If M5Burner shows the information `Hard resetting via RTS pin...` below, it means chip has been erased successfully.*
|
||||
|
||||

|
||||
|
||||
|
||||
**3. Click `Burn`**
|
||||
|
||||

|
||||
|
||||
*If M5Burner shows the information `Leaving... Staying in bootloader.` below, it means chip has been burnt successfully.*
|
||||
|
||||

|
||||
|
||||
#### ***Note:***
|
||||
***1. If M5Burner means be busy after clicking `Burn`, please wait for a few minutes. It'll be normal after the firmware has been burnt successfully.***
|
||||
|
||||
***2. If the burning procedure has been interrupted(like M5Burner has been closed suddenly...), it's better to burn your board again.***
|
||||
@@ -0,0 +1,75 @@
|
||||
How to Burn Firmware
|
||||
====================
|
||||
|
||||
This article will guide you how to burn a right firmware to your board.
|
||||
|
||||
For MacOS
|
||||
---------
|
||||
|
||||
**(Coming soon...)**
|
||||
|
||||
For Windows
|
||||
-----------
|
||||
|
||||
1. Download M5Burner
|
||||
::::::::::::::::::::
|
||||
|
||||
For downloading M5Burner, visit the `offical
|
||||
website <http://www.m5stack.com>`__ please.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/download_M5Burner.png
|
||||
|
||||
2. Burn the firmware
|
||||
::::::::::::::::::::
|
||||
|
||||
Unpack the M5Burner tool which you donwloaded for official website just
|
||||
now in any folder, then execute the executable file ``M5Burner.exe``.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_01.png
|
||||
|
||||
Then choice the ``serial port`` which is connected with your board and
|
||||
the ``Baud`` which is 921600 following below steps.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_02.png
|
||||
|
||||
**Note:**
|
||||
^^^^^^^^^^^
|
||||
If only ``COM1`` exists at the option, you need to visit this article `establish_serial_connection`_ and reinstall the USB driver.
|
||||
|
||||
.. _establish_serial_connection: establish_serial_connection.html
|
||||
|
||||
a. Choice a right firmware
|
||||
"""""""""""""""""""""""""""
|
||||
|
||||
a. select ``M5Flow-vx.x`` option, if you want to program with
|
||||
`M5Flow <http://flow.m5stack.com>`__
|
||||
|
||||
b. select ``M5Cam-vx.x (/M5Cam-psram)`` option, if you own a ESP32CAM (/
|
||||
M5CAMERA)
|
||||
|
||||
b. Click Erase
|
||||
"""""""""""""""""""""""""""
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_06.png
|
||||
|
||||
If M5Burner shows the information ``Hard resetting via RTS pin...``
|
||||
below, it means chip has been erased successfully.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_04.png
|
||||
|
||||
c. Click Burn
|
||||
"""""""""""""""""""""""""""
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_03.png
|
||||
|
||||
If M5Burner shows the information ``Leaving... Staying in bootloader.``
|
||||
below, it means chip has been burnt successfully.
|
||||
|
||||
.. image:: ../../_static/getting_started_pics/burn_firmware_05.png
|
||||
|
||||
**Note:**
|
||||
^^^^^^^^^^^
|
||||
|
||||
* If M5Burner means be busy after clicking ``Burn``, please wait for a few minutes. It'll be normal after the firmware has been burnt successfully.
|
||||
|
||||
* If the burning procedure has been interrupted(like M5Burner has been closed suddenly...), it's better to burn your board again.
|
||||
|
||||