🏷️QR code detector
With this feature it's possible for Misty to detect and read QR codes. These can be used to tag spaces, for example: labs, classrooms, kitchens or living rooms to make Misty start actions.
Last updated
With this feature it's possible for Misty to detect and read QR codes. These can be used to tag spaces, for example: labs, classrooms, kitchens or living rooms to make Misty start actions.
Last updated
We suggest to use a printed QR code, about 15x15 cm. The QR code that we used for this project is the Misty Lessons one.
This project will only work in the Misty Desktop Environment because we will modify the events file.
Open the folder containing the Python-SDK that you use for the desktop environment. The folder should look like this one.
Open the folder MistyPy, open the file Events.py in Visual Studio code and modify the Events class to add the QRdetection Event.
Now you're ready to use Misty's scanning QR capabilities in Python.
In the first part of the code, we set the robot by initializing the libraries, calling it and setting it in a standard position. Once these actions are done we start the event like any other event in the Misty world by calling the action .start_qr_tag_detector().
We create a function that will handle the data read by scanning the QR code. We can then register the event and then keep it alive.
You can insert if statements to handle different QR codes and assign to each a different Misty action.
For example, if we want Misty to turn her RGB LED purple when she recognizes the QR code of the Misty lessons or have the RGB LED red when she doesn't, our function can look like this one: