-
1Read the MicroPython Tutorial
Read the blog article: #Micropython: Getting Started! and install MicroPython on the WeMos board.
-
2Get the code!
Download the repository: uPyEcho.
-
3Modify the following lines in the 'boot.py'
ssid_ = your ssid wp2_pass = your wpa2 password
-
4Modify the following lines in 'main.py'
a- The code line:
ws2812_chain = WS2812(ledNumber=ledNumber, brightness=100)
defines the WS2812 LED strip. The argument 'ledNumber' defines the size of the LED strip. In my case, I used 144 LEDs.
b- The code lines:
devices = [ {"description": "white lights", "port": 12340, "handler": rest_api_handler((255,255,255), 50)}, ... ]
define the devices that are going to be found by Amazon Echo. As I said before, you can add up to 5 devices, but there are some limitation, please read this article. You need to define a name (e.g. 'white lights'), a port (e.g. '12340'), and a class (e.g. 'rest_api_handler') that is used as a handler. If you want to use further the 'rest_api_handler' class, you can select the LED color in RGB (e.g. white > '(255,255,255)'), and the brightness of the LED stripin % (e.g. '50'). The WS2812b class uses the SPI unit, and the pin 23 as data pin. Do not forget to connect the also the GND.
-
5Start a device search from Amazon Echo
You can use the Alexa application, or just say, "echo/alexa, search for new devices" and wait.
-
6Turn on/off a device
Say, "echo/alexa, turn on the 'white lights'", it should work, if not, leave a comment or write me.
-
7Upload the code to the board, connect the LED strip and restart the board
Read this article and use 'ampy'.
-
8Further questions?
Read the following article.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.