Basics:
This clock can display words as well as numbers, it connects to twitter to source words, either random or submitted by twitter users. It uses the camera to send out pictures of things it has displayed too.
More details about how to use it can be found on nixiebot's tumblr
To see what it has been getting up to, take a look at Nixiebot's time line. ( beware, it reads like youtube comments sometimes! )
Overview of operation:
A Raspberry Pi is interfaced via TTL level serial I/O to a series of Smartsocket boards each of which contain a PIC processor and high voltage driver transistors to drive a vintage Burroughs B7971 neon indicator tube.
There is a separate board that houses high voltage power supply modules for the neons and a high current 5V regulator to feed the Pi.
The Pi is fitted with a camera module pointed at the display and runs raspbian linux hosting a python program which does these things:
- It displays the time, set via NTP over the internet.
- It also uses the Twython package to access twitter and read from the random sample stream and display random tweets on the tubes every twenty seconds or so.
- The random tweets are placed in a big circular buffer that is used to compile live stats about current tweeting behavior, such as the "originality index" which is the ratio of tweets to retweets.
- It uses twitter's twitter's stream filter API to listen out for any tweets that contain the hashtag NixieBotShowMe
- These tweets are queued and at regular intervals (spaced so as not to violate twitter's posting rate limit rules) it will:
- Pop the oldest message off the queue and parse it to see if it contains a word that can be displayed, or a hashtag that commands another action (such as picking an "eight ball" answer at random ).
- Full command details are here on nixiebot's tumblr
- If so it will further check to see if any image processing hashtags have been added to the tweet and apply the appropriate image setting to the pi camera. it then checks the length of the word ("word" is any sequence of characters bounded by whitespace, so to display a phrase use a non displaying character like a colon to:separate:the:words:in:a:phrase:like:this ).
- If the word fits on the tubes it will take a still image.
- if the word is too long it will scroll the word and take a lower resolution image of each scroll position.
- These scroll frames are then composed into an animated gif using the Graphicsmagick library.
- Once an image or movie is generated it will compose a tweet in reply, attach the image or movie and upload it to twitter where it becomes visible on Nixiebot's time line.
- Pop the oldest message off the queue and parse it to see if it contains a word that can be displayed, or a hashtag that commands another action (such as picking an "eight ball" answer at random ).
- Any temporary files are then cleared up.
- These tweets are queued and at regular intervals (spaced so as not to violate twitter's posting rate limit rules) it will:
- Loop repeats.