Love these new Galactic and Cosmic unicorns. Thank you for creating these Pimoroni team!
I have been working on an app to send pictures to one or multiple Cosmic unicorns. It can be used to send any picture to the unicorn but this first implementation is focused on sending emojis as a 32x32 picture.
Converting emoji to pixels by writing the 32x32 emoji font to html canvas, then to scrape the pixel information back off the html canvas. Then send the byte array over to the unicorn. This is a bit hacky. On tablet and mobile, sometimes it’s a couple pixels off, and will require some tweaks to get this fixed. If anyone has suggestion of a better way to do this, please let me know.
Used the cosmic_paint app as a starting point, and built a custom UI on top of cosmic_paint.py, sending pixels one by one over websocket. This was ending up being very slow to update, and the unicorn would crash from out of memory errors quite frequently.
Second version, updated cosmic_paint.py that instead of sending pixel by pixel, to allow sending the full byte array over websocket. This updated the unicorn much faster than pixel by pixel, but still crashed a lot.
Third version, removed websocket, and using basic POST to send the byte array. Added a GET method to pull the byte array off the unicorn, to be able to determine “what image is being displayed on this unicorn right now?”
Thanks for reporting that Hel. I had not tested on Windows and Android yet, and did get repro of this issue on my Kindle Fire tablet. Was able to find a new technique that fixes this for all OS types. Also adding brightness control and the ability to paint Apple, Android, Facebook, and Twitter style emojis from any OS. Will let you know when that ships