Fluid Edge Themes

May the (holiday) force be with you

When I decided to make a miniature LEGO Christmas scene of my own, I wanted to integrate some things to make it more personal. Christmas is already my favorite holiday, so I knew I wanted to keep the snowy look. Star Wars also had a big influence on me, so I picked that as the theme. 

The main snowy location in Star Wars films is, of course, Hoth. The fictional planet was not populated by intelligent life prior to the Rebel’s Echo Base being located there, but I would like to think that perhaps centuries after the battle, it became a tourist spot. There’s probably not much to do on Hoth except winter sports, so I think they could use a theater; specifically, a drive-in movie theater. 

I knew I wanted a Star Wars themed drive-in theater for my Christmas village. Working professionally with displays, I had plenty of choices on hand. There are two questions that remained: what material to construct it out of, and what movie(s) to show. After making a prototype in cardboard, LEGO eventually rose to the top of my list. According to brickset.com there are currently about 750 different LEGO Star Wars sets out there, of which I happen to have a dozen or so, including the 5197 piece Millennium Falcon, a Christmas present from my wife back in 2008. This seemed like not only a quick build method but with so many sets and more to come, it is something that I could build up over time. And, of course, the brick people will be watching LEGO Star Wars!

The Falcon had been partially disassembled in a box, probably missing more than a few pieces, but now I could breathe new life into it. With an assist from my wife, we spent several hours just taking the pieces apart and sorting them. I found a particular open frame 4×6 LEGO piece that looked like it would fit the mounting tabs on Amulet’s MK-070C-HP smart display.

 

Using 4 of these frames and connecting them together to be sturdy was my next task. The tabs on the MK-070C-HP are not equal, which allows for quick identification of orientation for installation in most hardware, but it was actually not as convenient to deal with here. The tabs that are closer together were a perfect multiple of LEGO studs. However the tabs that are further apart were not, so I couldn’t make it as stable as I wanted, but the crossbars held it together well enough. Finally, I added more of the open frame 4×6 blocks to provide an anchor point as well as a path to route the USB Mini-B power cable that will power this system. 

 

Now that the frame was done, it needed some walls, roof, and support structure. The front panel needed to have the a cutout for the movie. Using my cardboard prototype as a model made quick work for this. I added some pivoting support beams in the front which would end up holding the bulk of the display’s weight. This piece snaps right onto the front of the frame. If you look at the reflection, you can also see the Explore the Iceland of Hoth poster on my office wall.

 

The front was now complete and it was time to fit the base and wrap the back and sides. My base piece was designed to hide the power cable that will come out the middle of the rear. The sides and back are all once piece and the corners are bendable, which makes installation much easier. It only attached on the sides, so the back is not attached directly to any frame or support. There’s even a little door to access the USB port for easily adding new movies.

 

To finish off this part of the build I needed a roof. I thought this might be a good place for some signage to be seen from ships flying in from orbit. I originally had “Drive -In” on there but I changed to the word “movie” in Aerubesh. The bottom of the roof only has one pivoting anchor point, so the roof can easily be rotated to the side to make it easy to open the USB access door.

 

Now it’s time to talk about how I used Amulet’s GEMstudio Pro software. The project running is very simple. The first page has some code to parse the file system looking for the right file type and then display a preview thumbnail of each video. The second page is nothing more than a way to dim the first page and display “Loading” while the file chosen is being read. The third page is where the magic happens. There is a new widget called a mediaArea which can read and display a new file type called .adv (for Amulet Document Viewer). This was originally conceived as a way to import PDF documentation into a project in a more easily manageable manner (i.e. not part of the compiled project). However, if one simply changes the “page” on a document fast enough, it appears to be a video.

 

Amulet has an existing converter for PDF files directly to .ADV format which you can inquire about, but for this application we have to jump through some hoops first because obviously a video is not a PDF. The converter can also take a folder of JPEGs with consecutive names and bundle them into an ADV file. The first step was to choose a video. I wanted something short to make the file size small, so this was perfect: Star Wars: The Last Jedi In 2 Minutes. A quick googling of YouTube downloaders let me obtain an MP4 of the video. With a free and open-source program called FFmpeg, the video is converted to a series of JPEGs. The converter can take it from there and output an ADV file. You can preview each page and select one to be the thumbnail/icon for the file system preview:

The format of the ADV file is broken up into 3 sections: Header, Directory, and Image Data. The header starts with the 2-byte count of pages. In this case, a “page” is a frame of the video. That is followed by 1 byte of flags and another byte that says how many sizes for each page (frame) exist. For example, a thumbnail and the original image make 2 sizes. On documents where zooming in is needed, such as large schematics, the Amulet LCD controller hardware can zoom and seamlessly change to an image with more detail. In this case, 3 or more sizes are required, but we’ll stick with 2 for this. The next 4 bytes are the location of the Icon, which is displayed by the first “Select a Movie” page in the project. The header is complete. The directory exists as a variable length array in the data structure after the header:

typedef struct {
     uint16_t    countOfPages;
     uint8_t     flags;          //For example, does the file contain Thumbnails.
     uint8_t     countOfSizes;    //per page  
     uint32_t    icon;            //Offset within file from beginning
     Pages       dir[];            //length = coutOfSizes * CountOfPages  
 } MultiPageDocument; 

The directory entries consist of a N/8 scaling factor for decompressing the JTAG (where N = 1 to 16, 8 means original size) and the offset of the compressed JPEG (each with a 20 byte header) relative to the beginning of the file. 

typedef struct {
     uint32_t    JpegScale_N_over_8;    //address of the decompressed file. Always starts out as 0 
     uint32_t    bmpOffset;        //offset of compressed image within this file 
 } Pages; 

Wrapping a JPEG in the 20-byte header is required formatting, but currently the actual data in that header is not used. That information is the file size, version of Amulet OS, the height and width, and the file type. The Amulet converter will populate in these values, but currently they could just be 20 zeroes for manually created ones. 

The GEMstudio project (download the GEMstudio project on Bitbucket) is configured to search the Movies directory of the on-board eMMC, so all that has to be done is to drop .ADV “video” files into that folder. 

https://youtu.be/ht7b-EiFkwg

 

Before putting everything together, I wanted one more piece to complete the scene. Drive-In theaters of the 50s and 60s had lots of great signs full of colors, lights, and often a large arrow. I didn’t think the vibrant colors would fit the theme, but I could sure do lights and an arrow. This wasn’t going to happen with just LEGO, so I reached out to one of Amulet’s engineers, Ian, for a 3D print assist. To tie it into the Star Wars theme, Ian used a Star Wars font for the sign. He printed the base as one piece and the arrow and text in a 2-piece clamshell. Ohh, and it also has a LEGO compatible base! Ian also did the initial protoboard wiring and glued in the LEDs. Once I received that, I painted the sign in the Star Wars classic yellow text on black background. The gray filament used was so close to the space gray LEGOs that I didn’t bother to paint the rest of it. I then used an Adafruit Trinket 5V to drive the LEDs and soldered everything up with a 4 AAA battery pack. (Download the 3D print files on Bitbucket.)

 

I made a base for the sign and turned the building for the battery pack into a shack shack. Below is the final scene, adding some fake snow to make it into a cavern, along with some LEGO terrain and a handful of transports. (You can download the GEMstudio code, Arduino code, 3D models, and one example “movie” on Bitbucket.)

https://youtu.be/EIZmXEFbtGg