As mentioned at the end of the last Scratch lesson, using the bit patterns to control the RGB-LED kit can get a little confusing, and it really does not fit in with how user friendly Scratch is intended to be. So, we need to help our friend Scratch talk to the RGB-LED kit in a way that is slightly more natural.
So how do we translate what Scratch is saying into a format that the scratch_gpio_handler can understand?
Well for these basic commands, we can allow the handler to look up any commands which include “rgb” using a handy RGB-LED universal translator, which we will call “rgb_ut.py”. At this stage, the universal translator will be given any message which the handler does not understand which has something to do with “rgb” and just return a translation of the message which he does understand. i.e. “rgballon” becomes “pinpattern1110000”
I am still developing the abilities of the “ut” at the moment, but there will be another Lesson coming soon which will explain how to install the RGB-LED Universal Translator (and update it as it changes) and some examples using it.
NOTE: I’ll also explain how it all works in more detail in the extra credit section of the lesson.