3.29.2014

Pi day mayhem with pie and Raspberry Pi

Concept
For Pi day last week, I hosted a party with a built-in social experiment. People ate pie, talked, danced a little. But at random intervals, the music was replaced by an air-raid siren with flashing red lights. That was the signal to grab the nearest whipped cream pie and splatter your neighbor.

The event was tons of fun, a Pi day unlike any Pi day before. Our pie battles escalated over the course of the evening, with larger armaments, more sophisticated tactics, and lots of scores to settle.

Here's how we set the whole thing up.

The human cost of war. Notice the characteristic pie-veteran arm-hang: everyone has pie on their fingers and no one wants to touch their own clothes.

Ingredients
  • Several pies to eat
  • ~12 pie tins
  • Lots of whipped cream
  • 1 Raspberry Pi
  • 1 Mini-jambox
  • 3 Phillips Hue lights
  • 6-8 Friends of the non-grudge-holding type

Lots of spent whipped cream tubes.

Setup
For music, I used pianobar, a Linux client for Pandora. Pianobar streams music (and blocks ads, more on that later) and also provides controls via command line eventcmd. That means that other scripts can adjust the volume, pause, and resume music playback.

For lights, I used Phillips Hue. These bulbs screw into a regular light socket, but can turn all kinds of pretty colors. You control them via wifi.

Last, I wrote a simple python script to dim the music, pause it, play an air raid siren, and make the lights flash red. After ~30 seconds, the lights go back to normal and the music fades back in.  The script is triggered via cron, with randomization to make it impossible to guess when the next pie fight will start.

Here's a short video showing the sound and light effects.

I've put all my code (it's not much, really) in [a github repo]. Starting from a RasPi with working sound and an internet connection, the configuration steps are:


  1. Install pianobar using apt-get.
  2. Configure pianobar.
  3. Clone defcon-radio in your home directory.
  4. Start pianobar.
  5. Configure your crontab to fire defcon-radio/defcon_radio.py every minute.

Learnings
Impending conflict does strange things to social interactions. Small talk becomes very difficult. People get territorial, keep glancing at the nearest pies and neighbors.

The picnic area. We started with pies interspersed with seating, so that anyone could grab a pie at the drop of a hat.
Phillips Hue lights are ridiculously easy to hack with. Find your hub via [], look up the Hue API, and ping it with the python requests library. I borrowed Hue lights for this event---didn't touch them until the day of the party---and it still took me less than an hour to get the whole lighting script to work.

Pianobar blocks ads. Pandora doesn't like it. When I first installed pianobar, I knew that it wasn't an authorized Pandora client, but I didn't realize that it blocks ads. It's a neat feature, but for obvious reasons, Pandora doesn't approve. If you stream music for too many hours, they will start to mess with your music stream---playing ads as songs, leaving long blocks of silence, etc. I don't know if pianobar works with PandoraOne. Because I spent a couple days testing the setup, Pandora blocked my account just before the party started. We dodged the problem for the party by switching to a different Pandora account for the evening.

The Arena: Later in the night, we switched to a Hunger-Games-style arena, with pies scattered throughout the yard. All the combatants lined up at the edge of the arena, waiting for the signal to dash out and throw pies.

Whipped cream washes out of clothes just fine. Also makes good styling gel.



1 comment:

  1. The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. machine learning projects for final year In case you will succeed, you have to begin building machine learning projects in the near future.

    Projects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.


    Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.


    The Nodejs Training Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

    ReplyDelete