We connect Ameba to WiFi and use Ameba as server, the user can control the LED on/off through a webpage.
We will connect Ameba to WiFi and use Ameba as server, the user can control the LED on/off through a webpage.
Ameba RTL8722DM is a low-power dual-band WLAN and Bluetooth Low Energy SoC by Realtek. The RTL8722DM also include memory for Wi-Fi protocol functions and application making it simple for anyone to develop various kind of IoT applications. At the same time it has a wide range of peripheral interfaces. With all these interfaces, it can connect to most of the electronics components like LEDs, temperature and humidity sensors, and so on
First, connect the Ameba with the LED.
In a LED, the longer pin is the positive pole and, the shorter pin is the negative pole. So we connect the shorter pin to GND and connect the longer pin to D13. Additionally, to avoid the electric current exceeds the tolerance of the LED and causes damage, we connect a resistance on the positive pole.
Then open "File" → "Examples" → "AmebaWiFi" → "SimpleWebServerWiFi"
In the sample code, ,modify the highlighted snippet to the corresponding information.
Upload the code and press the reset button on Ameba. When the connection is established, you will see the message "To see this page in action, open the browser to http://xxx.xxx.xxx.xxx" in Arduino IDE, as shown in the figure above.
Next, open the browser of a computer or phone under the same WiFi domain, enter the address in the message.