What to learn?
Embracing the Magic of Bionic Flowers
Welcome to a fascinating adventure with our AI Blossom kit! Here, you’ll merge the artistry of nature with cutting-edge technology. Inspired by the enchanting movements of water lilies and mimosa plants, these AI-Blossoms mimic nature’s response to stimuli, blending the wonders of biology with mechanical precision.
Unleash your creativity and programming skills! Whether you’re a beginner or a seasoned coder, our user-friendly Open Roberta Lab and C++ programming options cater to all levels. The kit provides everything needed to bring these flowers to life – control their movements in real-time through a computer interface or a dedicated phone app. Create mesmerizing flower ballets, sync them with music, or trigger actions with incoming messages, all through a simple transmitter. It’s an enthralling experience that combines nature, technology, and art in one!
How It Works
The AI-Blossoms come to life through signals sent by a dedicated transmitter. It is the brains of the operation. It receives instructions either from a computer through a serial protocol or from a phone via Bluetooth.
App Controls and Connection
To utilize the application’s diverse control interfaces, such as a remote-like controller,
pose controls, sound and picture recognition, you need to establish a connection
between your phone and the transmitter. Ensure that both Bluetooth and GPS on
your device are turned on before following these steps:
- Press the top-right icon to view available transmitters nearby.
- Click on any transmitter from the list to initiate the connection process
The control interfaces share similar icons, each serving a specific function:
Python Library
Discover how to command SkySpirit flowers from your computer using our Python
library. This library acts as a link, allowing your computer to communicate with the
transmitter using a serial protocol. Here, you’ll find examples to easily grasp and
utilize the library’s features.
Step 1:
Install VSCode from this link: https://code.visualstudio.com/download
Step 2:
Go to extensions.
Step 3:
Find and install the Python extension from Microsoft.
Step 4:
Restart VSCode
Step 5:
Go to File → Open Folder.
Step 6:
Navigate to the SkySpirit library folder and open it.
Step 7:
Make sure that the controller (esp) is plugged into the computer with a
data cable, and flowers are connected to a power source.
Open any of the four example files and click the play button in the top right
corner.
Custom Sequences
Now that you have VSCode and Python extension installed you can learn to control SkySpirit AI-Blossoms from your computer using our Python library.
This section gives you clear instructions to make the most of the library’s features
Step 1:
Create a new folder named ”your folder name” and copy ”Skyspirit flower controller” into ”your folder name”.
Create a new file named ”main.py”.
Start the file with:
from Skyspirit_flower_controller import Communicator, list_ports
This will include the Communicator class and the list ports function from the local library Skyspirit flower controller.
Step 2:
Create an instance of the Communicator class. On Linux:
communicator = Communicator(’/dev/ttyACM0’)
Or on Windows:
communicator = Communicator('COMI')
Step 3:
It’s recommended to create a Communicator instance using the list_ports function:
communicator = Communicator(list_ports()[0])
Here, 0 means that we are using the first found port. If you have other serial devices connected or want to use two transmitters simultaneously, you might want to change this 0 to another number:
communicator = Communicator(list_ports()[1])
or
communicator = Communicator(list_ports()[2])
Step 4:
The Communicator class has two functions: send_color
and send_move
. Both of them take a Python list of integers as the first argument. For send_color
, the next arguments are RGB values of the desired color (red, green, blue), ranging from 0 to 255.send_move
takes two integer values: the desired position (from 0 to 120) and the desired_speed
in terms of rotations per minute (from 0 to 4500):
communicator.send_color([9, 8, 6], 0 ,0, 255)
communicator.send_move([1, 2, 3], 120, 4000)
This code will set flowers 9, 8, 6 to bright blue color and fully open flowers 1, 2, 3 fast.
Step 5:
To introduce a delay between the execution of different commands, use the Python time library:
import time
For example, if you want the previous code to first change color and then open flowers 3 seconds later, you will write:
communicator.send_color([9, 8, 6], 0, 0, 255)
time.sleep(3)
communicator.send_move([1, 2, 3], 120, 4000)
Step 6:
Don’t forget to turn off lights and to close the flower at the end of your sequence:
communicator.send_color(list(range(1, 17)), 0, 0, 0)
communicator.send_move(list(range(1, 17)), 0, 500)
This code will turn off the light for all flowers from number 1 to 16 and close them slowly.
The full code will look something like this:
from Skyspirit_flower_controller import Communicator, list_ports
import time
communicator = Communicator(list_ports()[0])
communicator.send_color([9, 8, 6], 0, 0, 255)
time.sleep(3)
communicator.send_move([1, 2, 3], 120, 4000)
time.sleep(5)
communicator.send_color(list(range(1, 17)), 0, 0, 0)
communicator.send_move(list(range(1, 17)), 0, 500)
Step 7:
To run this code, choose File → Save, then click the play button in the top right
corner.
Flashing Code
If, for any reason, you need to reinstall the original code on your flowers or transmitters, follow these instructions:
Step 1:
Install VSCode from this link: https://code.visualstudio.com/download.
Step 2:
Go to extensions.
Step 3:
Find and install the PlatformIO extension.
Step 4:
Restart VSCode.
Step 5:
Go to File → Open Folder.
Step 6:
Navigate to controller_flash or flower_flash folder and open it.
Step 7:
Connect the ESP to the computer via a data cable.
Step 8:
Open the PlatformIO extension, go to esp32dev for flower_flash or to
adafruit_qtpy_esp32c3 for controller_flash. Choose Custom and click ”Upload prebuilt code”.