|
| 1 | +Read and display HTML file from SD card |
| 2 | +======================================= |
| 3 | + |
| 4 | +.. contents:: |
| 5 | + :local: |
| 6 | + :depth: 2 |
| 7 | + |
| 8 | +Materials |
| 9 | +--------- |
| 10 | + |
| 11 | +- `AMB82-mini <https://www.amebaiot.com/en/where-to-buy-link/#buy_amb82_mini>`_ x 1 |
| 12 | + |
| 13 | +- MicroSD card |
| 14 | + |
| 15 | +Example |
| 16 | +------- |
| 17 | + |
| 18 | +Procedure |
| 19 | +~~~~~~~~~ |
| 20 | + |
| 21 | +Using a card reader, connect the SD card to a computer and copy the HTML |
| 22 | +file into the SD card. Take note to place the file in the root directory |
| 23 | +and not in any folder. The HTML sample file can be downloaded at |
| 24 | +https://github.com/ambiot/ambpro2_arduino/tree/dev/Ameba_misc/Example_Samples/Web_test.html. |
| 25 | + |
| 26 | +|image01| |
| 27 | + |
| 28 | +Then insert the MicroSD card into the SD card slot of the AMB82 MINI |
| 29 | +board. |
| 30 | + |
| 31 | +Open the example, "Files" -> "Examples" -> "AmebaFileSystem" -> |
| 32 | +"ReadHTMLFile" |
| 33 | + |
| 34 | +In the sample code, modify "ssid" to the WiFi SSID to be connected to |
| 35 | +and "pass" to the network password. |
| 36 | + |
| 37 | +|image02| |
| 38 | + |
| 39 | +Upload the code and press the reset button on the board once the upload |
| 40 | +is finished. |
| 41 | + |
| 42 | +Wait for the board to connect to WiFi. When the connection is |
| 43 | +established, the message "To see this page in action, open a browser to |
| 44 | +http://xxx.xxx.xxx.xxx" will be printed in the serial monitor. |
| 45 | + |
| 46 | +|image03| |
| 47 | + |
| 48 | +Next, on a device connected to the same network, use a web browser to |
| 49 | +open the address provided in the serial monitor. The following web page |
| 50 | +will be displayed. |
| 51 | + |
| 52 | +|image04| |
| 53 | + |
| 54 | +.. |image01| image:: ../../../_static/amebapro2/Example_Guides/File_System/Read_and_display_HTML_file_from_SD_card/image01.png |
| 55 | + :width: 694 px |
| 56 | + :height: 440 px |
| 57 | +.. |image02| image:: ../../../_static/amebapro2/Example_Guides/File_System/Read_and_display_HTML_file_from_SD_card/image02.png |
| 58 | + :width: 568 px |
| 59 | + :height: 677 px |
| 60 | +.. |image03| image:: ../../../_static/amebapro2/Example_Guides/File_System/Read_and_display_HTML_file_from_SD_card/image03.png |
| 61 | + :width: 667 px |
| 62 | + :height: 444 px |
| 63 | +.. |image04| image:: ../../../_static/amebapro2/Example_Guides/File_System/Read_and_display_HTML_file_from_SD_card/image04.png |
| 64 | + :width: 3895 px |
| 65 | + :height: 1235 px |
| 66 | + :scale: 30% |
0 commit comments