The Button

This is probably one of the most enjoyable projects I’ve ever done. A basic explaination of what it is is a button that kicks Jennifer-Lawrence. Thats it.

Unfortunately, the actual implementation is a little more complicated, with 2 python scripts running on the host computer, and a IRC client running 24/7 to act as a IRC Bot

Hardware Requirements

Hardware Setup

setup

breadboard

Software Setup

flowchat

The software is composed of 3 main parts. The Arduino Software, the WeeChat script, and the button listening server.

Arduino Software

The Arduino software is very simple, the flow chart was more complicated than the actual code.

arduino

A text description is, the arduino turns on the LED when it is sending presses to the computer. during the time of the LED being on, it looks for a digital read on the analog input the button is plugged into.

Weechat Script

This script is more complicated. To avoid the flaws (in both my code and weechat’s python script api) this script handles all the communication between the Listening Server and the IRC client. This python script registers itself as a weechat script, calls the listener and then waits for it to exit. When the listener server exits with the correct error code, it will run the code to kick Jennifer-Lawrence (or any other poor soul who is configured to be kicked).

Listener Script

This script listens for button presses on the linux input device for the Arduino, and then exits with a proper exit code if it was a correct button press, this code is passed through to the above weechat script.