This project started when the office got its hands on an Epson TM-U325PD M133A receipt printer that prints dot matrix images, which dots the paper with red and black dots to print text. Eddie wrote a library to convert digital images and text into a printable format that the printer printed.
We knew that this old and slow printer had little use in today's fast moving modern world. But word on the street was that old things were now considered 'hipster'. So, we decided to link the printer to Twitter, one of the fastest and most efficient social media sites, via Python code on the Raspberry Pi. Tardygram was born.
Using tweepy, we connected to the Twitter API. First, we used OAuth Authentication to gain access to the API. Then, we set up a stream that only received tweets that included '@tardygram' in the tweet's text. (A stream allows us to monitor tweets in real time and look for specific tweets) If the tweet checked out, we downloaded the image onto the Pi using the urllib module. Then, we printed its image and its text on the Epson printer.
The next step was to take a picture of the print out using our Logitech C270 webcam that was connected to the Pi through USB. We used pygame’s camera module to capture the image. Then we used Python Imaging Library to rotate and add contrast to the image before sending the final product back to the sender.
In order to guarantee a stable photo, we built a frame for the webcam to attach to. I designed a blueprint for the laser cutter to follow using Inkscape and assembled the cut out pieces using lots of superglue. We also made a simple led circuit that provides a flash for the webcam.
In the end, Tardygram became the first of its kind. Although there will be significant obstacles and daunting hindrances, we believe in the power of Tardygram. One day, Tardygram will rule this world.
Thanks to Josh, James, Peter, Ed, and Eddie for helping with this project!