Skip to content

Add DisplaySDJPG_ILI9341_TFT Example Guide #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion source/FAQ/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ Ameba FAQ

ameba-pro2_mipi_connection

gpio_pins_output_voltage
gpio_pins_output_voltage

yolov7_reparameterization

sensor_replacement
10 changes: 10 additions & 0 deletions source/FAQ/sensor_replacement.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. tags:: sensor, camera, amb82-mini, replacement

Is there a source for JXF-37 sensor replacement?
================================================

**Answer**

Unfortunately, there is no source for replacement as the manufacturer for JXF-37 does not sell them individually. If possible, you may want to try with another sensor model instead, please refer to the list of supported sensors in `FreeRTOS SDK <https://github.com/Ameba-AIoT/ameba-rtos-pro2/blob/main/project/realtek_amebapro2_v0_example/inc/sensor.h>`_.

When choosing your sensor, please note that AMB82 Mini is only compatible with MIPI type sensors.
11 changes: 11 additions & 0 deletions source/FAQ/yolov7_reparameterization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. tags:: reparameterization, yolov7, amb82-mini

How to do reparameterization for customized YOLOv7-tiny model?
==============================================================

Reparameterization is used to reduce trainable BoF modules into deploy model for fast inference. For example merge BN to conv, merge YOLOR to conv, ..etc However, before reparameterization, the model has more parameters and computation cost.reparameterized model (cfg/deploy) used for deployment purpose

**Answer**

You may clone a copy of `YOLOv7 repo <https://github.com/WongKinYiu/yolov7>`_ into your local machine and perform reparameterization there.
Else, you may create a copy of this `Kaggle notebook <https://www.kaggle.com/code/kevinl00/yolov7-reparameterization-only>`_, upload your best trained model pt file and perform reparameterization on Kaggle. After running all the lines correctly, you can download your reparameterized model ``best_reparam.pt`` and use it on Ameba.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ A class for data manipulation of files in a file system.
+---------------------------+------------------------------------------+
| File::playmp3 | Execute convertMp3TArray. |
+---------------------------+------------------------------------------+
| File::readFile | Read data according to opened file size |
+---------------------------+------------------------------------------+

**File::File**
--------------
Expand All @@ -84,7 +86,7 @@ Constructs a File object.
~~~~~~~~~~~~~~

filename: pointer to a char array containing the path of the file to open.
fileType: The macro of the file type defined in AmebaFatFSFile.h to support different opening steps for different types of file.
fileType: The macro of the file type defined in AmebaFatFSFile.h to support different opening methods for different types of file.

**Returns**
~~~~~~~~~~~
Expand Down Expand Up @@ -118,6 +120,7 @@ Open a file from the file system.
~~~~~~~~~~~~~~

filename: pointer to a char array containing the path of the file to open.
fileType: The macro of the file type defined in AmebaFatFSFile.h to support different opening methods for different types of file.

**Returns**
~~~~~~~~~~~
Expand Down Expand Up @@ -178,7 +181,7 @@ Write data to the currently open file.

size_t write(uint8_t c);
size_t write(const uint8_t* buf, size_t size);
size_t write(const char* str;
size_t write(const char* str);
size_t write(const char* buf, size_t size);

**Parameters**
Expand Down Expand Up @@ -599,4 +602,38 @@ NA

NA

.. note :: "AmebaFatFSFile.h" must be included to use the class function.

**File::readFile**
------------------

**Description**
~~~~~~~~~~~~~~~

Read opened data file according to its file size, malloc is done within API, no pre-definition of fixed size buffer needed.

**Syntax**
~~~~~~~~~~

.. code-block:: c++

bool readFile(unsigned char *file_data, uint32_t &file_size);

**Parameters**
~~~~~~~~~~~~~~

file_data: buffer pointer for the file to be read

file_size: the size of the file to be read

**Returns**
~~~~~~~~~~~

True if the file data is read successfully, false if failed to read file data.

**Example Code**
~~~~~~~~~~~~~~~~

NA

.. note :: "AmebaFatFSFile.h" must be included to use the class function.
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
Display SD JPG ILI9341 TFT
==========================

.. contents::
:local:
:depth: 2

If you are not familiar with SPI, please read `Introduction to SPI <https://www.amebaiot.com/spi-intro/>`_ first.

Materials
---------

- `AMB82-mini <https://www.amebaiot.com/en/where-to-buy-link/#buy_amb82_mini>`_ x 1

- ILI9341 TFT LCD with SPI interface x 1

- microSD card x 1

Example
-------

- QVGA 2.2″ TFT LCD

- http://www.lcdwiki.com/2.2inch_SPI_Module_ILI9341_SKU:MSP2202

Common pins in ILI9341 TFT LCD with SPI interface:

- MOSI: Standard SPI Pin

- MISO: Standard SPI Pin

- SLK: Standard SPI Pin

- CS: Standard SPI Pin

- RESET: Used to reboot LCD.

- D/C: Data/Command. When it is at LOW, the signal transmitted are commands, otherwise the data transmitted are data.

- LED (or BL): Adapt the screen backlight. Can be controlled by PWM or connected to VCC for 100% backlight.

- VCC: Connected to 3V or 5V, depends on its spec.

- GND: Connected to GND.

**AMB82 MINI and QVGA TFT LCD Wiring Diagram:**

|image01|

Open the example, “File” -> “Examples” -> “AmebaSPI” -> “DisplaySDJPG_ILI9341_TFT”

|image02|

Modify the file name according to the image saved name.

|image03|

Compile and upload to Ameba, then press the reset button.

Then, you can see the image displayed on the LCD screen.

.. |image01| image:: ../../../../_static/amebapro2/Example_Guides/SPI/LCD_Screen_ILI9341_TFT/image01.png
:width: 1020 px
:height: 593 px

.. |image02| image:: ../../../../_static/amebapro2/Example_Guides/SPI/DisplaySDJPG_ILI9341_TFT/image02.png
:width: 707 px
:height: 841 px

.. |image03| image:: ../../../../_static/amebapro2/Example_Guides/SPI/DisplaySDJPG_ILI9341_TFT/image03.png
:width: 1095 px
:height: 702 px
:scale: 90%

1 change: 1 addition & 0 deletions source/ameba_pro2/amb82-mini/Example_Guides/SPI/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ SPI
.. toctree::
:maxdepth: 1

Display SD JPG ILI9341 TFT
LCD Screen ILI9341 TFT